Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more predefined variables #217

Merged

Conversation

PatOConnor43
Copy link
Contributor

Summary

This PR adds more predefined variables like ${file} and ${workspaceFolder} which should match VS Code examples defined here.

Motivation

I was trying to create a Go Delve configuration that used ${fileDirname} based off these docs. I don't know if you have any interest in supporting all of these but they were simple enough to construct so I figured I'd include as many as I could.

With this variable I can now construct a config that looks like this to debug all tests within a package:

    {
      type = "go",
      name = "Debug package tests", -- configuration for debugging test files
      request = "launch",
      mode = "test",
      program = "${fileDirname}/...",
    },

Also, it looks like ${file} in this repo is relative to the workspace but ${file} in VS Code is absolute. I don't know if that was intentional or not, just an FYI. Thanks for taking the time to review 馃槃

@mfussenegger
Copy link
Owner

Looks good to me. Could you also update the docs in the dap.txt?

@PatOConnor43
Copy link
Contributor Author

@mfussenegger I think this is ready to review again. Thanks!

@mfussenegger mfussenegger merged commit e92ef2a into mfussenegger:master Jun 25, 2021
@mfussenegger
Copy link
Owner

Thanks again 馃憤
Merged the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants