nvim-dap how to configure target executable? #2512
Replies: 6 comments
-
Looking at the docs, this doesn't seem to be an option. |
Beta Was this translation helpful? Give feedback.
-
OK sounds like a good idea. I thought |
Beta Was this translation helpful? Give feedback.
-
@jrunestone did you find any workaround? |
Beta Was this translation helpful? Give feedback.
-
No sorry I disabled the plugin. Never really got used to language and debugging support in neovim, I recently switched to zed-editor instead. |
Beta Was this translation helpful? Give feedback.
-
I worked a bit on it, and I got this to work for my rust debugger: Here is my {config, helpers, pkgs, ...}:
{
plugins = {
dap = {
enable = true;
extensions.dap-ui.enable = true;
adapters.servers.codelldb = rec {
port = "\${port}";
executable = {
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
args = ["--port" "${port}"];
};
};
configurations.rust = [{
type = "codelldb";
name = "Rust Debug";
request = "launch";
program = helpers.mkRaw "
function()
vim.fn.jobstart('cargo build')
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end
";
}
];
};
};
} |
Beta Was this translation helpful? Give feedback.
-
The nvim-dap module has yet to be refactored to latest standards, and should get some documentation love when it does.. I also have a fairly robust nvim-dap configuration that I use for debugging multiple different projects for work and side projects https://github.com/khaneliman/khanelivim/blob/fbc004758de53f6b4a67e37e51fa8701b2cc9ccb/packages/khanelivim/plugins/dap.nix if someone needs some more examples of how to configure it. |
Beta Was this translation helpful? Give feedback.
-
nvim-dap
unstable
Description
Pretty sure this isn't a bug, but how do I do anything other than hard-coding the path to the target debug executable in the dap configuration section? The examples over at the nvim-dap repo uses a lua function. Can I not pass it like this? I'm not getting any errors but the program doesn't launch. Hard-coding a file path does work.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions