Vscode-java-debug: clickable stack trace in java debugger output

Created on 29 Apr 2020  Â·  6Comments  Â·  Source: microsoft/vscode-java-debug

If I am running in the Java debugger and there is an exception, it would be nice if you could command click on a stack trace element to go to that line of the class you clicked on - just like you can when you are compiling and you click on errors that take you to the source of the compile error.

Environment
  • Operating System:
    macOS 10.14.6
  • JDK version:
    13+33
  • Visual Studio Code version:
    1.44.2
  • Java extension version:
  • Java Debugger extension version:
    0.25.1
Steps To Reproduce
  1. Run a Java program in the debugger which throws an exception and causes a stack trace to be printed to the debugger output window

If possible, it would be great for the Java debugger extension to parse output and make each stack trace element for which it has a source path clickable. Not sure how easy detection of stack trace output would be but parsing for Exception: on one line followed by lots of lines with "at (*.java:###)" might catch most instances. Thank for for an awesome integrated Java debugger!

Most helpful comment

BTW in the latest debugger, we also support jumping to source code when printing stack trace in the TERMINAL.

All 6 comments

if your output is printed the TERMINAL, not supported yet. Not sure whether the upstream VS Code expose the interface for the extensions to render clickable link.

But if your output is printed to DEBUG CONSOLE, it already supports jumping to stack trace source code. You can add a user setting "java.debug.settings.console": "internalConsole" to make output go to DEBUG CONSOLE.
image

Yeah I see this works in the debug console. I should be able to just use that. Thanks for the guidance!

@testforstephen Hi, we've been looking into adding jumping to a stack trace source code in our extension, but I can't seem to find how it's being done here. Is it coming from DAP? Is it a specific property or is this handled inside the extension here? It would be awesome if you could give me any hints.

Ignore me, I found how it's done :smile:

BTW in the latest debugger, we also support jumping to source code when printing stack trace in the TERMINAL.

Oh that’s very good to know thank you for mentioning this!

On Nov 17, 2020, at 4:19 PM, Jinbo Wang notifications@github.com wrote:

BTW in the latest debugger, we also support jumping to source code when printing stack trace in the TERMINAL.

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-java-debug/issues/798#issuecomment-729332809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMZOUHHREWM7XBGMGC6JEDSQMVLVANCNFSM4MTNFAJA.

Was this page helpful?
0 / 5 - 0 ratings