Inspect all stratas to find a source file#9433
Conversation
| convertSlash (csf.getSourcePath (stratumn)), true | ||
| convertSlash (csf.getSourcePath (csf.getDefaultStratum())), true | ||
| ); | ||
| for (var anyStratum : csf.getAvailableStrata()) { |
There was a problem hiding this comment.
This fallback is only applied if url is still null after all previous attempts. E.g. this fallback shall not have any impact on cases where the URL was found previously.
In Kotlin sources, it seems to work OKeish - the line is selected according to Java strata (that good). However the debugger strata remains Kotlin. As such the current PC line isn't highlighted, just selected. Not ideal, but I am afraid to switch the strata behind the scene - who knows how that would work in JSPs, etc.?
| private static final Pattern PACKAGE = Pattern.compile("package *([\\p{Alnum}+\\.$]+) *"); | ||
| private void createNewBreakpoint(String url, int line, final DebuggerManager m) { | ||
| try { | ||
| var b = LineBreakpoint.create(url, line); |
There was a problem hiding this comment.
This is a tedious piece of code that every JVM language needs to write to allow LineBreakpoint. I am convinced that LineBreakpoint should be a core debugger feature and should be applicable to any line in any file automatically.
That's why I'd like to introduce LineBreakpoint next to ide/api.debugger/src/org/netbeans/api/debugger/Breakpoint.java and automatically handle placing it everywhere (in .txt files, or .md files, etc.). It would then be up to various debuggers (like JPDA debugger) to pick all such generic LineBreakpoints up and use them.
Of course, that would be for a separate PR and review...
.ktfile.ktfilethere are too many strata and the default one is Kotlin
when the strata is switched to Java the debugger line gets selected in the editor
hence this PR tries all available strata to find any line in any existing editor
with this the stepping seems to work
TBD: placing a breakpoint in the Kotlin source