Docs on `env` is not accurate
aimran-adroll opened this issue · comments
Debug adapter definition and debug configuration
I installed the go DAP via DAPInstall
I am trying to inject environmental variables. The doc says
...snip
options?: {
env?: {} -- Set the environment variables for the command
cwd?: string -- Set the working directory for the command
}
I tried putting env
underneath options and it did not work.
Instead, this is my configuration and it works just fine
dap.configurations.go = {
{
type = "go",
name = "app4",
request = "launch",
program = "${file}",
args = {"foo.log"},
env = {
DB_PORT = "4599",
}
}
}
Might this be the case of stale documentation or did I just get lucky.
Thanks again for an awesome plugin
Debug adapter version
sha=9fcff6e
Steps to Reproduce
See my config vs whats in the docs
Expected Result
env
variables should work
Actual Result
env
variables do NOT work as described in the docs
The documented env
option you linked is for environment variables that are used when starting the debug adapter. The env
option in dap.configurations
is used when starting the debugee (and whether that is supported depends on the debug adapter)
This is working as documented.