Skip to content

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 PatOConnor43 force-pushed the more-predefined-variables branch from 4db0365 to 07152c8 Compare June 22, 2021 16:07
@PatOConnor43
Copy link
Contributor Author

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

@mfussenegger mfussenegger force-pushed the more-predefined-variables branch from 07152c8 to e92ef2a Compare June 25, 2021 11:54
@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.

2 participants