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.
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.
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.
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
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 havetype
defined, resulting in an error fromnvim-dap
.nvim-dap
configurations,name
has to be a string, whileprogram
can be a function as well. Assigningcommand.cmd
to bothname
andprogram
prevents the user from using a function to computeprogram
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 withtype
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.