Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] nvim-dap how to configure target executable? #1271

Open
1 task done
jrunestone opened this issue Mar 15, 2024 · 2 comments
Open
1 task done

[BUG] nvim-dap how to configure target executable? #1271

jrunestone opened this issue Mar 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jrunestone
Copy link

Field Description
Plugin nvim-dap
Nixpkgs unstable
Home Manager `unstable
  • I have read the FAQ and my bug is not listed there.

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.

programs.nixvim.plugins.dap.configurations.c = [{
  name = "Debug";
  type = "gdb";
  request = "launch";
  program = ''
    function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end
  '';
}];

Thank you.

@jrunestone jrunestone added the bug Something isn't working label Mar 15, 2024
@Bodleum
Copy link
Contributor

Bodleum commented Mar 18, 2024

Looking at the docs, this doesn't seem to be an option.
We could change plugins.dap.configurations.* to be attrs of anything and allow the user to configure it according to the plugin docs, similar to how cmp.settings works.

@jrunestone
Copy link
Author

jrunestone commented Mar 19, 2024

OK sounds like a good idea. I thought program already worked like that since it's not explicitly specified in the nixvim config (but type, request, name are). Hard-coding the path doesn't really lend itself to a generic configuration :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants