vscode-java
vscode-java copied to clipboard
Open class files in VSCode and add a debug breakpoint anywhere
I'm trying to add a breakpoint in a class library. I must first open the target library class file (decompiled), and add a breakpoint later.
But it looks like I can view the class library only while debugging the java application. How can I goto specific library class file in vscode?
You can use the top menus "Go -> Go to Symbol in Workspace..." (shortcut Ctrl + T) to search any class you want.
@testforstephen Does it work for symbols outside the project? I'm trying to set a breakpoint on spring framework, which is a library imported from maven.
yes, it searches for all classes including source files and library classes.
@testforstephen It works for class names, not class methods, is that expected?
Yes, it only searchs the classes by default, that's by design.
We have a setting java.symbols.includeSourceMethodDeclarations
to control whether to include methods from source files during symbol search. This is off by default. However, it does not include the methods in the library due to performance considerations.
Usually, I use Ctrl + T
to search the target class first, then using Ctrl + Shift + O
to search method in current opened file.
However, it does not include the methods in the library due to performance considerations.
Any chances to create a new setting for that?
No plan yet. It's very slow to search methods from all libraries.
I think with new parallel index search in jdt.core searching for methods should be fast. I have a eclipse implementation as a plugin just for this which is faster for larger workspaces as well. So may be having setting might be good to use as a circuit breaker for really slow workspaces.