mxsdev / nvim-dap-vscode-js

nvim-dap adapter for vscode-js-debug
271 stars 27 forks source link

Support `startDebugging` request #15

Open mxsdev opened 1 year ago

mxsdev commented 1 year ago

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.

JbIPS commented 1 year ago

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?

mxsdev commented 1 year ago

@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.

JbIPS commented 1 year ago

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!

igorlfs commented 1 year ago

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

mxsdev commented 1 year ago

@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.

MijikHna commented 1 year ago

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.