automaton.nvim icon indicating copy to clipboard operation
automaton.nvim copied to clipboard

type used twice in launch.json

Open lobneroO opened this issue 1 month ago • 1 comments

I just wanted to give this workflow another shot and while setting up my debug settings in the launch.json, I noticed that "type" is used twice - once for the execution type (shell / process) and once for the dap selection (e.g. cppdbg). While this works, I don't think it's a good idea to reuse the name. I don't know if the dap selection overrides the previous type or if they are read separately and it just happens to work. I'd suggest to use "dapConfig" or just "dap" for the latter entry.

The two type entries are also explained in the wiki.

lobneroO avatar Nov 11 '25 15:11 lobneroO

I need to check the code deeply, but if I remember correctly the type "shell/process" is related to the Task configuration only (not used by DAP).

Code used by Tasks configurations (type is validated): https://github.com/Dax89/automaton.nvim/blob/master/lua/automaton/runner.lua#L326

Instead, the Launch configuration's layout is built around DAP, which has its type field (ignored by automaton) and everything gets forwarded to it (if launched in debug), otherwise the plugin just executes the command ignoring that field.

Code used by Launch configurations: https://github.com/Dax89/automaton.nvim/blob/master/lua/automaton/runner.lua#L343

So I'm 99% sure that the wiki is wrong and it needs to be adjusted.

Dax89 avatar Nov 12 '25 17:11 Dax89