You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is there any way that I can debug javascript through the LSP4 IJ plug-in #684
I am using the IntelliJ Idea Community version, which does not support debugging javascript. Is there any way that I can debug javascript through the LSP4 IJ plug-in? Will the LSP4 IJ plug-in have the ability to support debug javascript or other files in the future? Thanks
@SCWells72 do you think you could be interested to implement DAP? I have implemented a DAP debugger for a language server (LSP server side), but never implement it for LSP client side.
@angelozerr, I'll be happy to take a look and see what might be involved. I've implemented a custom debugger using the JB plugin SDK, and it's no small amount of work. I'll need to understand DAP and then try to map its concepts to the IDE's custom debugger SDK to understand just how much work this actually is...
@angelozerr, I perused the DAP specification today and it's pretty much what I expected based on our discussion the other day. However, also as discussed, it looks...BIG! I'm not sure it's something I'd be able to take on anytime soon. I certainly think I could split duties with someone else where, for example, I implemented the IDE extension points for a custom debugger against an existing DAP client that someone else has provided. I think it will also be critical to prioritize the various features and determine what constitutes a minimally viable product for a DAP integration and what can/should be added in subsequent iterations (which seems to follow the LSP4IJ model anyway).
I'm happy to spend some time chatting through how that might work and what division of responsibilities would make sense, but I definitely can't commit to taking something this large on myself with all of my other obligations right now.
@PassingByThs@SCWells72 after spending a lot of time to translate DAP support from LSP4E (DAP support for Eclipse) in IntelliJ I have an uggly POC and debugging (JavaScript only , not TypeScript) starts working:
My goal now is to create a PR with a clean and generic code. Debugging TypeScript, manage evaludation,etc will be done in the future. My goal is to provide a basic DAP support that we will improve step by step.
Activity
angelozerr commentedon Dec 11, 2024
To debug JavaScript, it requires that LSP4IJ must implement and support DAP https://microsoft.github.io/debug-adapter-protocol/
Once this support will be implemented, we could use https://github.com/microsoft/vscode-js-debug
A nice article explains that with neovim which supports DAP https://www.darricheng.com/posts/setting-up-nodejs-debugging-in-neovim/
To implement DAP for IJ we could port DAP support from LSP4E https://github.com/eclipse-lsp4e/lsp4e/tree/main/org.eclipse.lsp4e.debug in IJ
@SCWells72 do you think you could be interested to implement DAP? I have implemented a DAP debugger for a language server (LSP server side), but never implement it for LSP client side.
SCWells72 commentedon Dec 11, 2024
@angelozerr, I'll be happy to take a look and see what might be involved. I've implemented a custom debugger using the JB plugin SDK, and it's no small amount of work. I'll need to understand DAP and then try to map its concepts to the IDE's custom debugger SDK to understand just how much work this actually is...
angelozerr commentedon Dec 11, 2024
That's a fantastic news! I suggest really that you use https://github.com/eclipse-lsp4e/lsp4e/tree/main/org.eclipse.lsp4e.debug and translate code from Eclipse API to IJ API. We did that for LSP support when we start (quickly) the project and to benefit from fixed issues from LSP4E.
angelozerr commentedon Dec 11, 2024
And if you have any questions, I could perhaps help you since I have implemented a DAP debugger on language server side.
SCWells72 commentedon Dec 13, 2024
@angelozerr, I perused the DAP specification today and it's pretty much what I expected based on our discussion the other day. However, also as discussed, it looks...BIG! I'm not sure it's something I'd be able to take on anytime soon. I certainly think I could split duties with someone else where, for example, I implemented the IDE extension points for a custom debugger against an existing DAP client that someone else has provided. I think it will also be critical to prioritize the various features and determine what constitutes a minimally viable product for a DAP integration and what can/should be added in subsequent iterations (which seems to follow the LSP4IJ model anyway).
I'm happy to spend some time chatting through how that might work and what division of responsibilities would make sense, but I definitely can't commit to taking something this large on myself with all of my other obligations right now.
angelozerr commentedon Jan 3, 2025
@PassingByThs @SCWells72 after spending a lot of time to translate DAP support from LSP4E (DAP support for Eclipse) in IntelliJ I have an uggly POC and debugging (JavaScript only , not TypeScript) starts working:
My goal now is to create a PR with a clean and generic code. Debugging TypeScript, manage evaludation,etc will be done in the future. My goal is to provide a basic DAP support that we will improve step by step.
angelozerr commentedon Jan 21, 2025
@PassingByThs if you want to test the dap support please install nightly-builds.
and read https://github.com/redhat-developer/lsp4ij/blob/main/docs/dap/user-defined-dap/vscode-js-debug.md
It is a basic dap support which is not perfect, please report issues and give us feedback.
PassingByThs commentedon Jan 24, 2025
Excellent work!🎉🎉🎉 It worked well with javascript. There is no errors I have found.
But it can not debug typescript directly unless compiled to javascript, which seems conflict as mentiond below.

angelozerr commentedon Jan 24, 2025
That's excellent! Thanks for your feedback!
It is possible since this debugger is used inside vscode and LSP4E uses it https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/VSCodeJSDebugDelegate.java.
I added a TODO at https://github.com/redhat-developer/lsp4ij/blob/main/docs/dap/user-defined-dap/vscode-js-debug.md#configure-the-typescript-file-to-rundebug
It is just a matter with Launch DAP parameters I think. I need to investigate more how to configure that.
To understand how to do that we need:
The first thing I will try it is to use this following config:
{ "type": "pwa-node", "request": "launch", "program": "${file}", "cwd": "${workspaceFolder}", "sourceMap": true, "outFiles": ["${workspaceFolder}/out/**/*.js"] }When you read doc at https://code.visualstudio.com/docs/typescript/typescript-debugging
It uses
preLaunchTask": "tsc: build - tsconfig.json",but it is specific to vscode, perhaps we could do the same thing with the before task (I don't know if it is working).
Please try it and give me feedback.
PassingByThs commentedon Jan 24, 2025
DAP parameters content disappeared when opened again.
angelozerr commentedon Jan 24, 2025
Indeed I have noticed this problem. I am fixing and providing run / debug with contextual menu
angelozerr commentedon Jan 24, 2025
@PassingByThs after spending a lot of times to debug vscode to understand how it configure VSCode Debug JS, I can debug TypeScript!
There are some bugs that I need to fix it, I will ping you when I will push my work.
angelozerr commentedon Jan 25, 2025
@PassingByThs please install again nightly-builds and read https://github.com/redhat-developer/lsp4ij/blob/main/docs/dap/user-defined-dap/vscode-js-debug.md#configure-the-typescript-file-to-rundebug
I have fixed your below issues.
You should (I hope) have the capability to debug TypeScript files, please report issues and give us feedback.
angelozerr commentedon Feb 14, 2025
@PassingByThs for your information LSP4IJ 0.10.0 has been released.
Is there any chance that you add a review at https://plugins.jetbrains.com/plugin/23257-lsp4ij/edit/reviews to speak about DAP support to help us to promote LSP4IJ DAP support. Reviews are very important for us to try to convince users to use LSP4IJ.
Thanks!