Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node /path/js-debug-adapter.js doesn't die on neovim exit #1352

Open
timsofteng opened this issue Oct 15, 2024 · 1 comment
Open

node /path/js-debug-adapter.js doesn't die on neovim exit #1352

timsofteng opened this issue Oct 15, 2024 · 1 comment

Comments

@timsofteng
Copy link

Debug adapter definition and debug configuration

local dap = require("dap")
require("dapui").setup()
dap.adapters["pwa-node"] = {
	type = "server",
	host = "localhost",
	port = "${port}",
	executable = {
		command = "node",
		args = {
			os.getenv("HOME") .. "/.local/share/nvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js",
			"${port}",
		},
	},
}

require("dap").configurations.javascript = {
	{
		type = "pwa-node",
		request = "launch",
		name = "Launch file",
		program = "${file}",
		cwd = "${workspaceFolder}",
	},
}

dap.adapters.chrome = {
	type = "executable",
	command = "node",
	-- command = "chrome-debug-adapter",
	args = { os.getenv("HOME") .. "/.local/share/nvim/mason/packages/chrome-debug-adapter/out/src/chromeDebug.js" }, -- TODO adjust
}

dap.configurations.typescriptreact = {
	{
		type = "chrome",
		request = "attach",
		program = "${file}",
		cwd = vim.fn.getcwd(),
		sourceMaps = true,
		protocol = "inspector",
		port = 9222,
		webRoot = "${workspaceFolder}",
	},
}

dap.configurations.javascriptreact = {
	{
		type = "chrome",
		request = "attach",
		program = "${file}",
		cwd = vim.fn.getcwd(),
		sourceMaps = true,
		protocol = "inspector",
		port = 9222,
		webRoot = "${workspaceFolder}",
	},
}

Debug adapter version

js-debug-adapter 1.94.0

Steps to Reproduce

1.Create file test.js with this simple code

let count = 0;

function logMessage() {
  if (count < 10) {
    count++;
    console.log("count", count);
    setTimeout(logMessage, 1000); 
  }
}

logMessage();
  1. Set breakpoint into line setTimeout(logMessage, 1000); .
  2. Run :lua require'dap'.continue().
  3. Run :lua require'dap'.restart().
  4. :qa.

Expected Result

All related not processes should be killed.

Actual Result

node /path/js-debug-adapter.js process exists.

@mfussenegger
Copy link
Owner

This sounds like a js-debug-adapter issue. nvim-dap sends a terminate for all active sessions started with launch, when vim exits and other debug adapters also quit cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants