fix(extras.lang.typescript): support node debug type along with pwa-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>
This commit is contained in:
Avinash Thakur 2024-05-15 19:38:15 +05:30 committed by GitHub
parent a8659d02b9
commit d36e3a5c73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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] = {