Skip to content

Commit

Permalink
fix(extras.lang.typescript): support "node" debug type in addition to…
Browse files Browse the repository at this point in the history
… "pwa-node"

"pwa-node" is deprecated in [vscode-js-debug](https://github.com/microsoft/vscode-js-debug) as documented in issue mxsdev/nvim-dap-vscode-js#68
  • Loading branch information
80avin committed Apr 14, 2024
1 parent bb36f71 commit 0e7745a
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions lua/lazyvim/plugins/extras/lang/typescript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,23 @@ return {
},
opts = function()
local dap = require("dap")
if not dap.adapters["pwa-node"] then
require("dap").adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {
require("mason-registry").get_package("js-debug-adapter"):get_install_path()
.. "/js-debug/src/dapDebugServer.js",
"${port}",
for _, debugtype in ipairs({ "pwa-node", "node" }) do
if not dap.adapters[debugtype] then
require("dap").adapters[debugtype] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {
require("mason-registry").get_package("js-debug-adapter"):get_install_path()
.. "/js-debug/src/dapDebugServer.js",
"${port}",
},
},
},
}
}
end
end
for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do
if not dap.configurations[language] then
Expand Down

0 comments on commit 0e7745a

Please sign in to comment.