nvim-dap icon indicating copy to clipboard operation
nvim-dap copied to clipboard

Won't terminate after the first encountered breakpoint on vscode-js-debug

Open foxt451 opened this issue 11 months ago • 9 comments

Debug adapter definition and debug configuration

{ "microsoft/vscode-js-debug", build = "npm install --legacy-peer-deps && npx gulp dapDebugServer && mv dist out", }

{ "mfussenegger/nvim-dap", dependencies = { "microsoft/vscode-js-debug", }, config = function() require("dap").adapters["pwa-node"] = { type = "server", host = "localhost", port = "${port}", executable = { command = "node", args = { vim.call("stdpath", "data") .. "/lazy/vscode-js-debug/out/src/dapDebugServer.js", "${port}", }, } } for _, language in ipairs({ "typescript", "javascript" }) do require("dap").configurations[language] = { { type = "pwa-node", name = "Node", request = "launch", program = "${file}", cwd = "${workspaceFolder}", console = "integratedTerminal", skipFiles = { "<node_internals>/", "${workspaceFolder}/node_modules/" }, }, } end

Debug adapter version

vscode-js-debug - latest commit 1e5bf60; nvim-dap - too

Steps to Reproduce

  1. Open this code:
console.log('Hello, world!');
 await new Promise((resolve) => setTimeout(resolve, 5000));
 console.log('Hello, world!'); // <---------------------BREAKPOINT HERE
 await new Promise((resolve) => setTimeout(resolve, 5000));
 console.log('Hello, world!'); 
  1. Try to terminate during first await - the process exits
  2. Then restart, stop on first breakpoint, continue, and terminate on the second await - nothing happens

Expected Result

Process terminates successfully during the second await too

Actual Result

Nothing happens when terminating during the second await

foxt451 avatar Feb 29 '24 10:02 foxt451