Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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

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

Successfully merging this pull request may close these issues.

2 participants