-
Notifications
You must be signed in to change notification settings - Fork 183
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
Support for vscode-js-debug #369
Comments
This might be of interest. |
Bump! I've been searching everywhere for ways to do js debugging in emacs, and this appears to be it. |
@MyriaCore you can use chrome/ff/node/edge debuggers currently available - you may follow https://emacs-lsp.github.io/lsp-mode/tutorials/reactjs-tutorial/ |
The installation instructions for node does not work for spacemacs. You have to |
Seems like VSCode Node Debug is deprecated these days in favor of vscode-js-debug. https://marketplace.visualstudio.com/items?itemName=ms-vscode.node-debug2
Also some relevant discussions I found: |
A bit off-topic, but would a different debugger support evaluating promises and callbacks while dap is stopped on a breakpoint? Currently, if I am on a breakpoint and I want to
This is a simplified example, but I've seen this in both node and chrome, with both callbacks and promises. |
See issue Eval async code while debugging(#553) |
@yyoncho Hey, are there plans to integrate this since the other extensions are deprecated? |
|
Any light at the end of the tunnel? Could desperately use this! |
Reading through this thread (which OP @pretentious7 posted above) and you'll find that currently So it's no wonder no one has stepped up to add support for The good news is this is changing: an addition to the DAP spec has been merged which So the outlook has brightened a bit, but @nbfalcon I suggest removing the |
I will check if we can fix this now. The blocker on the server side is fixed. |
Initial support is posted here: #733 For those who want to test: I have downloaded the version from here: microsoft/vscode-js-debug#1388 (comment) . Then you have to adjust dap-js-debug-program accordingly. I have to decide whether we want/need the support for hierarchical debug sessions and I am not 100% sure what kind of use case they support. |
Sweet, thanks for tackling this! I'll try it out ASAP.
By this you mean support for debugging spawned Node processes? IMO maybe the most compelling use case for this is integration tests. The app I work on these days runs on Node, as do its integration tests. The integration test code spawns a process for the app with That said, I see no reason that this needs to be supported right off the bat. Just basic single-process functionality with |
@eeshugerman I am not that familiar with nodejs but I think that we kind of support now this usecase. Normally, one dap mode starts the adapter and connects to it. For that particular one, we start the adapter, and then the adapter sends us a message to start a new session against the same port. So, I guess if there is a debug config that will result in multiple new debug sessions(I. e. multiple children of the base debug session) this will work too. |
Ah cool! I'll try that out then, hopefully later today! |
Just took this for a spin and it's looking good!
|
@eeshugerman good. I am looking for feedback for:
|
FWIW I added a method Here it is also sample configuration that I am using for testing: {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Demo",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/server.js"
}
]
}
|
Good stuff! I'll stick with this for the next few days of work keeping those points in mind and get back to you with a more in-depth testing report. |
I just submitted PR #736 if interested in taking part or all of it. Was something I had started on a while back, and just got more time lately to work on it. Not trying to step on toes, missed other dap-js commit last week. ❤️ Tested and works great with Edit: while Lastly, I did not update configuration.md, since I think there is a wider discussion of looking at removing some of the older (not working?) and redundant Javascript legacy adapters such: Please let me know if have any questions or comments. Thanks! |
@yyoncho I've continued to run your branch over the past couple weeks and again overall it's working nicely, but
I think there may be some issues here; I usually end up running
Yes, putting the child under the parent in the sessions buffer would be a nice improvement. The names are fine as-is IMO. Lastly I've run into issues with the output buffers getting in the way of each other. Each process gets its own output buffer (e.g. |
Hello. I don't know if that helps but this is my story. I was trying to debug cucumber-js tests using launch.json content {
"name": "Launch dev acceptance tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/cucumber-js",
"cwd": "${workspaceRoot}/test",
"args": ["--tags", "@only", "--parallel", "1"],
},
And I got this error.
Trying to fix this, I came to realize that By looking at those discussion, I undertand that I tried #733 and it worked quite well. The only issue I faced for now is that I could not run Now, there is also #736, that looks more comprehensive at first glance and also works quite well. It also does not work with I don't understand what it means but I share it anyway, in case it helps. I'm glad that I have something usable to debug my cucumber tests. Thank you 👍 |
I'm glad you tried it out and provided this feedback!
|
@Konubinix Ignore my previous comment that I edited to strike out. TLDR; I updated the PR #736 for the I remembered why I had the Instead I realized that the child session was being added to the list of configurations, even though it cannot run by itself. The "last" debug configuration should be parent, not the child. I look for the child being last configuration, and remove it if there now. I also re-synced the ~3 changes from upstream master, and reformatted a few long-lines. Thank you again for trying it out and the feedback. |
@jeff-phil : I confirm that I don't have the issue anymore. |
Hey, Generally speaking this seems to work, I am running into a few issues:
Happy to debug more, I need a bit of help figuring out HOW to debug! |
@ryanobjc- Excuse the clarifications on this (now 3 year) old thread. :)
Which, if any, PR are you using?
Do you happen to have a simple test example to reproduce issues? And can you share your launch.json? |
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
Why was this closed when the PR is still open? I do notice there's a dap-js file in main but no documentation on it? |
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug]. `dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`. [vscode-node-debug]: https://github.com/microsoft/vscode-node-debug [vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug [vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2 [vscode-js-debug]: emacs-lsp/dap-mode#733 [pr]: emacs-lsp/dap-mode#369
https://github.com/microsoft/vscode-js-debug
This ships with VSCode by default, but can also be installed via the Marketplace. It might be nice to have
dap-mode
working with this.The text was updated successfully, but these errors were encountered: