nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

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

Open jrunestone opened this issue 11 months ago • 6 comments

Field Description
Plugin nvim-dap
Nixpkgs unstable
Home Manager `unstable

  • [x] 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 avatar Mar 15 '24 15:03 jrunestone

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.

Bodleum avatar Mar 18 '24 16:03 Bodleum

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 :)

jrunestone avatar Mar 19 '24 08:03 jrunestone