Jumping to source when clicking stack trace link in debug console#258
Jumping to source when clicking stack trace link in debug console#258testforstephen merged 11 commits intomasterfrom
Conversation
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
There was a problem hiding this comment.
My suggestion is to only keep the part that generates the source info. The stream related changes need to revisited from solution perspective.
| logger.log(Level.SEVERE, String.format("Read data from io exception: %s", e.toString()), e); | ||
| } | ||
|
|
||
| requestSubject.onComplete(); |
There was a problem hiding this comment.
How come we didn't call this before?
There was a problem hiding this comment.
If we don't call onComplete(), the new thread created by RXJava will never die. There will be lots of RXJava threads alive after running the debug session multiple times.
...re/src/main/java/com/microsoft/java/debug/core/adapter/handler/StackTraceRequestHandler.java
Outdated
Show resolved
Hide resolved
....debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/ILaunchDelegate.java
Outdated
Show resolved
Hide resolved
...g.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchRequestHandler.java
Outdated
Show resolved
Hide resolved
| null, | ||
| null | ||
| }; | ||
| Pattern stacktracePattern = Pattern.compile("\\s+at\\s+(([\\w$]+\\.)*[\\w$]+)\\(([\\w-$]+\\.java:\\d+)\\)"); |
There was a problem hiding this comment.
Is the launcher's responsibility to process the stack trace?
I would suggest that we have a dedicated place to host such logic.
There was a problem hiding this comment.
The pattern object could be stateful. Please double check the behavior by processing multiple stacktraces in the same debug session.
There was a problem hiding this comment.
See https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
Pattern is unstateful, all state is saved in Matcher, so multiple Matchers can share the same pattern instance.
...g.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchRequestHandler.java
Outdated
Show resolved
Hide resolved
...soft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/ProcessConsole.java
Outdated
Show resolved
Hide resolved
...soft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/ProcessConsole.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * constructor. | ||
| */ | ||
| public ProcessConsole(Process process) { |
There was a problem hiding this comment.
OK. I got the whole point now. You are merging two streams. This can be done by simply calling Observable.mergeWith. It's the consumers' choice to merge those streams together. The underlying provider should keep it clean and simple.
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
...g.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchRequestHandler.java
Outdated
Show resolved
Hide resolved
...va.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/JavaStackTraceConsole.java
Outdated
Show resolved
Hide resolved
...va.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/JavaStackTraceConsole.java
Outdated
Show resolved
Hide resolved
...va.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/JavaStackTraceConsole.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
…re sending TerminatedEvent Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
…o jinbo_stackjump
...soft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/ProcessConsole.java
Outdated
Show resolved
Hide resolved
...soft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/ProcessConsole.java
Outdated
Show resolved
Hide resolved
com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/protocol/Events.java
Outdated
Show resolved
Hide resolved
| */ | ||
| public Observable<ConsoleMessage> lineMessages() { | ||
| return this.messages().map((message) -> { | ||
| String[] lines = message.output.split("(?<=\n)"); |
There was a problem hiding this comment.
this is a positive lookbehind regex. Able to split lines and keep delimiter.
...g.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchRequestHandler.java
97AE
Outdated
Show resolved
Hide resolved
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
…o jinbo_stackjump
The requested review comments are addressed in the new update.
Signed-off-by: Jinbo Wang jinbwan@microsoft.com
This closes microsoft/vscode-java-debug#490 and closes microsoft/vscode-java-debug#506