Skip to content

Commit

Permalink
fix(extras.lang.typescript): support node debug type along with `pw…
Browse files Browse the repository at this point in the history
…a-node` (#2983)

* feat(typescript): add "node" debug adapter

add "node" debug adapter for compatibility with .vscode/launch.json

* refactor: ...

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
  • Loading branch information
80avin and folke committed May 15, 2024
1 parent a8659d0 commit d36e3a5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lua/lazyvim/plugins/extras/lang/typescript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ return {
},
}
end
if not dap.adapters["node"] then
dap.adapters["node"] = function(cb, config)
if config.type == "node" then
config.type = "pwa-node"
end
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] = {
Expand Down

0 comments on commit d36e3a5

Please sign in to comment.