Shatur / neovim-tasks

A statefull task manager focused on integration with build systems.
GNU General Public License v3.0
108 stars 10 forks source link

Improvements on DAP integration. #22

Open undyamon opened 10 months ago

undyamon commented 10 months ago

I was playing around with nvim-dap and its integration with this plugin and I think I found a couple of bugs.

https://github.com/Shatur/neovim-tasks/blob/2730051a3ff2eaf34e392f2304bab217d884fc30/lua/tasks/runner.lua#L120-L127

  1. According to nvim-dap documentation, dap.configurations.<filetype> is a list of configurations. In case the list is present, it is force-updated in line 121 to include a bunch of key-values; this results in a table with said key-values and a bunch of configurations. In particular this table doesn't have type defined, resulting in an error from nvim-dap.
  2. In nvim-dap configurations, name has to be a string, while program can be a function as well. Assigning command.cmd to both name and program prevents the user from using a function to compute program on the fly.

For (2), I would give a custom name only if no dap configuration is present; in that case it can be moved with type and be something like 'tasks-' .. command.dap_name or similar. For (1), I'm not sure why one would need multiple configurations so I don't know how to go about it, or which config to choose when multiple are present.

Shatur commented 10 months ago

Thanks! I implemented this plugin long time ago, probably something changed. I agree with the suggestion for (2). For (1) I would just pick first and warn if there are multiple ones.