From d36e3a5c73c07f54b31c4ec5334f68ed5492123e Mon Sep 17 00:00:00 2001 From: Avinash Thakur <19588421+80avin@users.noreply.github.com> Date: Wed, 15 May 2024 19:38:15 +0530 Subject: [PATCH] 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 --- lua/lazyvim/plugins/extras/lang/typescript.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 4e3846ec..a1c6aba1 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -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] = {