daplf/vscode-java-kotlin

How to debug the Java plugin?

Opened this issue · 3 comments

I'm trying to set this up locally and make some changes. I need some help figuring out how to actually setup debugging for the Java parts of the plugin?

I'd also be great if we document it somewhere. Thanks!

daplf commented

Hey, apologies for the delay.

To debug the plugin, your best bet is to follow the README. Running the build.sh script will build the JAR used by the JDT LS and place it in the correct folder. After that you only need to debug the extension (using F5) or package it and install it from a VSIX.

If you're not used to debugging VSCode extensions, it might be helpful to look at this guide: https://code.visualstudio.com/api/get-started/your-first-extension

@daplf, Thanks for your reply!

I'm able to debug the vscode extension. What I'm looking for is a way to debug to JAR itself, which runs as plugin to the java language server. I was having a hard time debugging the Java part of the extension.

daplf commented

@nisargjhaveri Ah, my bad then. I'm not really sure how to do that either. I'm guessing you could in theory do this if you were able to start JDT LS yourself manually and have vscode-java connect to it. This way you could start JDT LS with a debugger. But I haven't touched vscode-java or JDT LS enough to know if it's possible.