jay-babu / mason-nvim-dap.nvim

GNU Affero General Public License v3.0
551 stars 39 forks source link

feat: automatically configure the vscode extension in `nvim-dap` #129

Closed mehalter closed 5 months ago

mehalter commented 5 months ago

nvim-dap provides a vscode extension that loads in launch.json files. It has an internal variable for the mappings from adapters to filetypes when loading configurations. This adds automatic support to connect the filetypes to the adapters defined by nvim-dap

Here is the variable: https://github.com/mfussenegger/nvim-dap/blob/master/lua/dap/ext/vscode.lua#L6

And here is where they use it: https://github.com/mfussenegger/nvim-dap/blob/master/lua/dap/ext/vscode.lua#L197

80avin commented 5 months ago

require('mason-nvim-dap.mappings.filetypes')) isn't complete and misses some very basic types actually.

I had found few for node-js and fixed in LazyVIM: https://github.com/LazyVim/LazyVim/pull/3165/files

But if this repo is going to take the responsibility of configuring the vscode extension, it should add these mappings also.

( I may myself raise PR, but not getting time. So, will be good if someone else can take it up )

mehalter commented 5 months ago

Those adapters are not handled by this plugin so it makes no sense for this plugin to add those mappings. It would be up to the user or whatever plugin creates those types to add it to this same structure.

mehalter commented 5 months ago

Looking at the LazyVim code, the "pwa-node" and "node" adapters are defined in the typescript extra in LazyVim itself. So it would be up to them to add those mappings. The adapter names are completely arbitrary and set up by the user or whatever so we cannot just make up random adapter names and set filetypes for them.

mehalter commented 5 months ago

@80avin here is a PR on LazyVim that fixes their configuration of vscode types: https://github.com/LazyVim/LazyVim/pull/3556