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

Support `startDebugging` request

Open mxsdev opened this issue 2 years ago • 6 comments

The DAP spec has officially added support for multi-session debug adapters - https://github.com/microsoft/debug-adapter-protocol/pull/344 🎉 🎉 🎉

According to @connor4312 in https://github.com/microsoft/vscode-js-debug/issues/902#issuecomment-1304592234:

Fyi this will soon be compliant with the adoption of https://github.com/microsoft/debug-adapter-protocol/issues/79 this month, though DAP clients may take longer to update.

This plugin currently runs in a hacky/non-intended way, and my hope is that by adhering to a unified specification, issues like #14, #6, and #1 may be solved (fingers crossed). Even if they are not solved, it will be significantly easier to properly investigate these issues, as well as to determine if they are usage issues or just bugs in the vscode adapter.

The first goal is implementation into nvim-dap, which is slated for implementation. Then I can implement that into this plugin, which will (I think) significantly cut down on the required amount of code.

The second goal is perhaps to implement this hierarchy tree as part of nvim-dap-ui, assuming that the maintainers there are interested in such a feature.

mxsdev avatar Nov 14 '22 00:11 mxsdev

Hi there!

I just saw that nvim-dap merge the startDebugging support. I'd like to help you integrate it here but I don't know what to do :sweat_smile:

Can I help?

JbIPS avatar Mar 03 '23 13:03 JbIPS

@JbIPS

Hi!

Would love to have your help, but unfortunately, while the specification has been integrated (and in nivm-dap too), we are still waiting on support in vscode-js-debug. See here for the relevant issue.

I suppose you could try to launch a PR with integration (probably want to branch off of the WIP in dap-server), but I have no idea how well it would be received, and even then I have no idea what the odds of it actually getting merged are. It does not appear that this feature is a priority for Microsoft, so it may be a while. I would probably do this personally, but not only do I not understand the codebase very well, I also don't understand the compliances and expectations Microsoft might have for such a feature at all.

At any rate, adoption should be pretty straight-forward after that point since session management would then be handled by nvim-dap. I actually pushed a branch, start-debugging, which is a WIP for integration. Would be interesting for sure to do some tests against the dap-server branch, to see if things would work as expected.

mxsdev avatar Mar 03 '23 14:03 mxsdev

Too bad, I thought all the issues had been resolved but missed this one.

I won't understand the codebase better than you and I think the PR would be ignored at best.

Looks like we just have to wait.

Thank you for the update!

JbIPS avatar Mar 07 '23 15:03 JbIPS

Hey, startDebugging has just been merged in vscode-js-debug

igorlfs avatar Mar 25 '23 12:03 igorlfs

@igorlfs

Working on getting support out by the end of the weekend!

Good opportunity to look at some of the issues as well if I get to it.

mxsdev avatar Mar 25 '23 16:03 mxsdev

Is this ticket also related that the local and remote (in my case docker container) directory will not be mapped in case of Typescript? I have expirienced that the debugger connects, but breakpoints, set in ts files, will not be hit. But If I set breakpoints in compiled js files debugger hits the breakpoints.

MijikHna avatar Mar 27 '23 11:03 MijikHna