fix(typescript): support chrome, node and msedge dap adapters (#6649)

## Description
Add support for `chrome`, `node` and `msedge` configs for dap
typescript.

## Related Issue(s)
https://github.com/LazyVim/LazyVim/pull/6328

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Alexey Svirshchevskiy
2025-10-20 12:25:13 +02:00
committed by GitHub
parent faeb24ba95
commit 0b65d33d85

View File

@@ -226,31 +226,34 @@ return {
}, },
opts = function() opts = function()
local dap = require("dap") local dap = require("dap")
if not dap.adapters["pwa-node"] then
require("dap").adapters["pwa-node"] = { for _, adapterType in ipairs({ "node", "chrome", "msedge" }) do
type = "server", local pwaType = "pwa-" .. adapterType
host = "localhost",
port = "${port}", if not dap.adapters[pwaType] then
executable = { dap.adapters[pwaType] = {
command = "node", type = "server",
-- 💀 Make sure to update this path to point to your installation host = "localhost",
args = { port = "${port}",
LazyVim.get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"), executable = {
"${port}", command = "js-debug-adapter",
args = { "${port}" },
}, },
}, }
} end
end
if not dap.adapters["node"] then -- Define adapters without the "pwa-" prefix for VSCode compatibility
dap.adapters["node"] = function(cb, config) if not dap.adapters[adapterType] then
if config.type == "node" then dap.adapters[adapterType] = function(cb, config)
config.type = "pwa-node" local nativeAdapter = dap.adapters[pwaType]
end
local nativeAdapter = dap.adapters["pwa-node"] config.type = pwaType
if type(nativeAdapter) == "function" then
nativeAdapter(cb, config) if type(nativeAdapter) == "function" then
else nativeAdapter(cb, config)
cb(nativeAdapter) else
cb(nativeAdapter)
end
end end
end end
end end
@@ -308,6 +311,15 @@ return {
end, end,
}, },
{
"jay-babu/mason-nvim-dap.nvim",
optional = true,
opts = {
-- chrome adapter is deprecated, use js-debug-adapter instead
automatic_installation = { exclude = { "chrome" } },
},
},
-- Filetype icons -- Filetype icons
{ {
"nvim-mini/mini.icons", "nvim-mini/mini.icons",