mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(typescript): add "node" debug adapter
add "node" debug adapter for compatibility with .vscode/launch.json
This commit is contained in:
parent
bb36f71b77
commit
41eae677c5
1 changed files with 16 additions and 0 deletions
|
|
@ -1,3 +1,7 @@
|
|||
local debugtypePreferred = {
|
||||
['node'] = 'pwa-node',
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
-- add typescript to treesitter
|
||||
|
|
@ -87,6 +91,18 @@ return {
|
|||
},
|
||||
}
|
||||
end
|
||||
if not dap.adapters['node'] then
|
||||
dap.adapters['node'] = function (cb, config)
|
||||
config.type = debugtypePreferred[config.type] or config.type
|
||||
local nativeAdapter = dap.adapters['pwa-node']
|
||||
if type(nativeAdapter) == 'function' then
|
||||
nativeAdapter(cb, config )
|
||||
else
|
||||
cb(nativeAdapter)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do
|
||||
if not dap.configurations[language] then
|
||||
dap.configurations[language] = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue