Open nicklayb opened 14 hours ago
I tried reproducing it with an empty mix project in VSCode
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "mix_task",
"name": "mix (Default task)",
"request": "launch",
"task": "run",
"taskArgs": ["lib/dap_env.ex"],
"projectDir": "${workspaceRoot}",
"env": {
"ELS_ELIXIR_OPTS": "--name elixirls@localhost --cookie elixirls"
},
"exitAfterTaskReturns": false
}
]
}
lib/dap_env.ex
defmodule DapEnv do
def hello do
IO.puts("hello")
IO.puts("""
#{Node.self()}
#{Node.get_cookie()}
#{System.get_env("ELS_ELIXIR_OPTS")}
""")
:world
end
end
DapEnv.hello()
and I'm seeing this output
hello
elixirls@localhost
elixirls
--name elixirls@localhost --cookie elixirls
I also tried a new phoenix project and a launch config identical to yours @nicklayb
mix phx.new dap_env_phx
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "mix_task",
"name": "phoenix server",
"request": "launch",
"task": "phx.server",
"projectDir": "${workspaceRoot}",
"env": {
"ELS_ELIXIR_OPTS": "--name elixirls@localhost --cookie elixirls"
},
"exitAfterTaskReturns": false,
"debugAutoInterpretAllModules": false
}
]
}
lib/dap_env_ph/application.ex
defmodule DapEnvPhx.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@impl true
def start(_type, _args) do
IO.puts("""
#{Node.self()}
#{Node.get_cookie()}
#{System.get_env("ELS_ELIXIR_OPTS")}
""")
children = [
DapEnvPhxWeb.Telemetry,
...
and once again it worked as expected
Generated dap_env_phx app
Running mix phx.server
elixirls@localhost
elixirls
--name elixirls@localhost --cookie elixirls
[info] Running DapEnvPhxWeb.Endpoint with Bandit 1.5.7 at 127.0.0.1:4000 (http)
Do you have a repo that reproduces it?
Precheck
Environment
Current behavior
Unable to start the
dap
adapter withELS_ELIXIR_OPTS
. I have this configuration:And added the following to
application.ex
When starting the debugger it outputs
Expected behavior
I would expect my dap environment to have the node name
elixirls@localhost
with cookieelixirls
and thatapplication.ex
would log