Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only step through project files when debugging in VSCode with Java

There are loads of questions asking about how to skip over node_modules, but I'm looking to skip over all non-project java files like Method.class and InvocableHandlerMethod.class. These are not node modules, so the usual settings in the launch.json don't work.

When I'm stepping over the code while debugging it's infuriating that I have to spend the vast majority of my time in some system library...

An example question that doesn't fit my needs is: Can't step through 'Just my code' when using VSCode?

Is there any way to configure debugging in VSCode and Java to only step through files that I've created in my project?

A perfect setup would be that I include folders for debugging, rather than exclude them as other questions specify.

like image 939
Dan Rayson Avatar asked May 10 '26 02:05

Dan Rayson


1 Answers

Finally there's a solution that does the job for me. I've tried adding this rule to my settings.json file and it works:

"java.debug.settings.stepping.skipClasses": ["$JDK", "org.junit.*", "junit.*", "java.util.*"]

Thanks to jdneo.

like image 164
aderchox Avatar answered May 12 '26 15:05

aderchox