-
Notifications
You must be signed in to change notification settings - Fork 174
Jumping to source when clicking stack trace link in debug console #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is to only keep the part that generates the source info. The stream related changes need to revisited from solution perspective.
@@ -100,6 +100,8 @@ public void run() { | |||
} catch (IOException e) { | |||
logger.log(Level.SEVERE, String.format("Read data from io exception: %s", e.toString()), e); | |||
} | |||
|
|||
requestSubject.onComplete(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come we didn't call this before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the mean of (?<=\n)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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