fix(mason-nvim-dap): correctly configure to auto-install debug adapters (#3493)

Tested with `php` and `kotlin` Extras. 

`kotlin` Extra doesn't have the debug adapter in Mason
`ensure_installed` and doesn't install automatically on its own.

`php` Extra has the debug adapter defined in Mason `ensure_installed`
and does correctly install automatically. However, this should not be
needed due to `mason-nvim-dap`. If you remove [these
lines](ed93ce9c15/lua/lazyvim/plugins/extras/lang/php.lua (L26-L33)),
then the debug adapter doesn't automatically install, but it should.

With the change introduced in this PR, both Extras automatically install
the debug adapters. `kotlin` Extra doesn't need anything else and in
`php` Extra the lines I mentioned previously can be removed or not. The
point is not to remove previously Mason dependencies with debug
adapters, but to correctly configure `mason-nvim-dap`, so in future
Extras you don't have to define the debug adapter inside a Mason
dependency.
This commit is contained in:
Iordanis Petkakis 2024-06-06 15:35:59 +03:00 committed by GitHub
parent ed93ce9c15
commit 86ba1bc62d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,6 +11,7 @@ local function get_args(config)
end end
return { return {
{
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
recommended = true, recommended = true,
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)", desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
@ -48,28 +49,6 @@ return {
"theHamsta/nvim-dap-virtual-text", "theHamsta/nvim-dap-virtual-text",
opts = {}, opts = {},
}, },
-- mason.nvim integration
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
},
},
},
}, },
-- stylua: ignore -- stylua: ignore
@ -119,4 +98,27 @@ return {
end end
vscode.load_launchjs(nil, filetypes) vscode.load_launchjs(nil, filetypes)
end, end,
},
-- mason.nvim integration
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
},
},
},
} }