Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

mehalter
Copy link
Contributor

@mehalter mehalter commented Jun 7, 2024

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

@jay-babu jay-babu merged commit a046867 into jay-babu:main Jun 7, 2024
3 checks passed
@mehalter mehalter deleted the vscode_ext branch June 7, 2024 21:47
@80avin
Copy link

80avin commented Jun 9, 2024

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
Copy link
Contributor Author

mehalter commented Jun 9, 2024

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
Copy link
Contributor Author

mehalter commented Jun 9, 2024

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
Copy link
Contributor Author

mehalter commented Jun 9, 2024

@80avin here is a PR on LazyVim that fixes their configuration of vscode types: LazyVim/LazyVim#3556

folke pushed a commit to LazyVim/LazyVim that referenced this pull request Jun 9, 2024
…3556)

`mason-nvim-dap.nvim` adds it's own adapter filetype mappings to the
vscode extension in `nvim-dap` (as of
jay-babu/mason-nvim-dap.nvim#129)

This also moves the type mappings for the `pwa-node` and `node` adapters
to where they are defined in the typescript pack.

Now that the default internal type mappings are configured we can rely
on the automatic loading of the `.vscode/launch.json` that `nvim-dap`
does
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants