From 14d71e85ab840439913bae68e8286afbdd583791 Mon Sep 17 00:00:00 2001 From: Uzair Aftab Date: Mon, 24 Apr 2023 07:39:22 +0200 Subject: [PATCH 1/2] fix(pack): Fix dap debugging --- .../pack/typescript/typescript.lua | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lua/astrocommunity/pack/typescript/typescript.lua b/lua/astrocommunity/pack/typescript/typescript.lua index db58009e5..a13ecfbbd 100644 --- a/lua/astrocommunity/pack/typescript/typescript.lua +++ b/lua/astrocommunity/pack/typescript/typescript.lua @@ -77,15 +77,20 @@ return { }, config = function() local dap = require "dap" - - local attach_node = { - type = "pwa-node", - request = "attach", - name = "Attach", - processId = function(...) return require("dap.utils").pick_process(...) end, - cwd = "${workspaceFolder}", + local dap_debug_server_js = vim.fn.stdpath "data" + .. "/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js" + dap.adapters["pwa-node"] = { + type = "server", + host = "localhost", + port = "${port}", + executable = { + command = "node", + args = { + dap_debug_server_js, + "${port}", + }, + }, } - dap.configurations.javascript = { { type = "pwa-node", @@ -94,26 +99,22 @@ return { program = "${file}", cwd = "${workspaceFolder}", }, - attach_node, } dap.configurations.typescript = { { type = "pwa-node", request = "launch", name = "Launch file", + runtimeExecutable = "deno", + runtimeArgs = { + "run", + "--inspect-wait", + "--allow-all", + }, program = "${file}", cwd = "${workspaceFolder}", - runtimeExecutable = "ts-node", - sourceMaps = true, - protocol = "inspector", - console = "integratedTerminal", - resolveSourceMapLocations = { - "${workspaceFolder}/dist/**/*.js", - "${workspaceFolder}/**", - "!**/node_modules/**", - }, + attachSimplePort = 9229, }, - attach_node, } end, }, From ee6833736b5c37affc1efbebce2e5631012db0ea Mon Sep 17 00:00:00 2001 From: Uzair Aftab Date: Mon, 24 Apr 2023 07:39:58 +0200 Subject: [PATCH 2/2] fix(pack): Make sure to mention in the README that TS debudding uses Deno --- lua/astrocommunity/pack/typescript/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/astrocommunity/pack/typescript/README.md b/lua/astrocommunity/pack/typescript/README.md index 97781a0e2..86eef4a2a 100644 --- a/lua/astrocommunity/pack/typescript/README.md +++ b/lua/astrocommunity/pack/typescript/README.md @@ -1,5 +1,7 @@ # TypeScript Language Pack +**Note**: The current version of TS debugging uses Deno! + This plugin pack does the following: - Adds `typescript`, `javascript`, and `tsx` Treesitter parsers