You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on a fix for the Python DAP issue #5079 I noticed another more general bug (regression?) that is also visible in the rust debugger, preventing the debugger from working:
2023-07-15T14:30:06.606 helix_dap::transport [ERROR] <- DAP error Some("Could not create a target for a program '{0}': unable to find executable for '{0}'.") (None) for command #1 launch
In languages.toml, (I believe) the value {0} is used to refer to the path of the current file, so as to pass that path to the debugger. The issue is that it is (no longer?) not being correctly converted from {0} to the actual path, and instead being passed literally.
First, using the python debugger, and now using the rust debugger, I observe this type of issue when I call :debug-start, per the reproduction below.
I tried this:
Having installed llvm and rust-analyzer (via brew, and added appropriate paths so that rust, so all is good on hx --health rust), and using the default languages.toml settings:
:debug-start
Status bar reports Async job failed: None
Check the logs by :log-open, scroll to bottom, find mention of {0}.
I expected this to happen:
debugger should work
Instead, this happened:
errors, as per summary
Helix log
~/.cache/helix/helix.log
2023-07-15T14:34:20.645 helix_dap::transport [ERROR] err: <- StreamClosed
2023-07-15T14:34:28.437 helix_view::handlers::dap [WARN] Unhandled event Process(Process { name: "run.py", system_process_id: Some(48577), is_local_process: Some(true), start_method: Some("launch"), pointer_size: Some(64) })
2023-07-15T14:34:29.413 helix_view::editor [ERROR] editor error: Debuggee failed to exit successfully (exit code: 1).
2023-07-15T14:34:29.416 helix_dap::transport [ERROR] err: <- StreamClosed
2023-07-15T14:35:54.301 helix_lsp::transport [ERROR] rust-analyzer err <- "[ERROR project_model::workspace] cyclic deps: helix_view(Idx::<CrateData>(123)) -> helix_tui(Idx::<CrateData>(116)), alternative path: helix_tui(Idx::<CrateData>(116)) -> helix_view(Idx::<CrateData>(123))\n"
2023-07-15T14:35:54.472 helix_dap::transport [ERROR] <- DAP error Some("Could not create a target for a program '{0}': unable to find executable for '{0}'.") (None) for command #1 launch
2023-07-15T14:35:54.472 helix_view::editor [ERROR] editor error: Async job failed: None
2023-07-15T14:35:54.799 helix_lsp::transport [ERROR] rust-analyzer err <- "[ERROR project_model::workspace] cyclic deps: helix_view(Idx::<CrateData>(123)) -> helix_tui(Idx::<CrateData>(116)), alternative path: helix_tui(Idx::<CrateData>(116)) -> helix_view(Idx::<CrateData>(123))\n"
2023-07-15T14:35:56.211 helix_lsp::transport [ERROR] rust-analyzer err <- "[ERROR project_model::workspace] cyclic deps: helix_view(Idx::<CrateData>(123)) -> helix_tui(Idx::<CrateData>(116)), alternative path: helix_tui(Idx::<CrateData>(116)) -> helix_view(Idx::<CrateData>(123))\n"
2023-07-15T14:36:07.760 helix_dap::transport [ERROR] <- DAP error Some("Could not create a target for a program '{0}': unable to find executable for '{0}'.") (None) for command #1 launch
2023-07-15T14:36:07.760 helix_view::editor [ERROR] editor error: Async job failed: None
2023-07-15T14:36:07.761 helix_dap::transport [ERROR] err: <- StreamClosed
2023-07-15T14:39:00.670 helix_dap::transport [ERROR] <- DAP error Some("Could not create a target for a program '{0}': unable to find executable for '{0}'.") (None) for command #1 launch
2023-07-15T14:39:00.671 helix_view::editor [ERROR] editor error: Async job failed: None
2023-07-15T14:41:09.073 helix_dap::transport [ERROR] <- DAP error Some("Could not create a target for a program '{0}': unable to find executable for '{0}'.") (None) for command #1 launch
2023-07-15T14:41:09.073 helix_view::editor [ERROR] editor error: Async job failed: None
2023-07-15T14:41:37.031 helix_lsp::transport [ERROR] taplo err <- "ERROR operation failed error=the LSP is not part of this build, please consult the documentation about enabling the functionality\n"
2023-07-15T14:41:37.032 helix_lsp [ERROR] failed to initialize language server: server closed the stream
2023-07-15T14:41:37.032 helix_lsp::transport [ERROR] taplo err: <- StreamClosed
thomasaarholt
changed the title
Helix interprets {0} from languages.toml literally in debugger/DAP
Helix interprets "{0}" from languages.toml literally in debugger/DAP
Jul 15, 2023
ah okay this turns out to be mostly a lack of documentation issue(though it could also be an issue with the design of the debug-start command as well as I was writing this I realized it wasn't) the {0} is actually taken from the args you pass to the command, it makes a bit more sense if you use the debug mode <space>G and then l to choose a debug template to use and then it asks you to fill in the different args for example if you click binary it will ask you for the binary name. When using :debug-start you should provide as the first arg the template to use for example binary or attach then you pass the rest of the args starting from {0} so the second argument to the :debug-start command would fill in that variable. It's probably better to use the <space>G commands because the have a better ui, To solve this issue though we might want to actually check that all the required args are provided, so it doesn't give the cryptic Async job failed: None and also doesn't start the debug session.
(diving into this also helped me fully understand how debug works, so thank you!)
Thank you very much for your comment! It sent me down a rabbit hole of learning about debugging templates, which I really should have done from the start.
Summary
Working on a fix for the Python DAP issue #5079 I noticed another more general bug (regression?) that is also visible in the rust debugger, preventing the debugger from working:
2023-07-15T14:30:06.606 helix_dap::transport [ERROR] <- DAP error Some("Could not create a target for a program '{0}': unable to find executable for '{0}'.") (None) for command #1 launch
In languages.toml, (I believe) the value
{0}
is used to refer to the path of the current file, so as to pass that path to the debugger. The issue is that it is (no longer?) not being correctly converted from{0}
to the actual path, and instead being passed literally.First, using the python debugger, and now using the rust debugger, I observe this type of issue when I call
:debug-start
, per the reproduction below.Reproduction Steps
asciinema: https://asciinema.org/a/1Ptaajq6M8ExJ7MWTazRMGS4N
I tried this:
Having installed llvm and rust-analyzer (via brew, and added appropriate paths so that rust, so all is good on
hx --health rust
), and using the defaultlanguages.toml
settings::debug-start
Async job failed: None
:log-open
, scroll to bottom, find mention of{0}
.I expected this to happen:
debugger should work
Instead, this happened:
errors, as per summary
Helix log
~/.cache/helix/helix.log
Platform
macS
Terminal Emulator
wezterm
Helix Version
helix 23.05 (57e538d)
The text was updated successfully, but these errors were encountered: