From 0e7745ad37eed4af3e1ea4c758462da1b522534f Mon Sep 17 00:00:00 2001 From: Avinash Thakur Date: Mon, 15 Apr 2024 00:34:38 +0530 Subject: [PATCH] fix(extras.lang.typescript): support "node" debug type in addition to "pwa-node" "pwa-node" is deprecated in [vscode-js-debug](https://github.com/microsoft/vscode-js-debug) as documented in issue https://github.com/mxsdev/nvim-dap-vscode-js/issues/68 --- .../plugins/extras/lang/typescript.lua | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 4bb280d608..476fbc6c83 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -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