Is there a API to display Stack Traces?

Is there any API that will display a stack trace in a tool window that also allows the user to click the line numbers and open the source file in an editor?

3 comments
Comment actions Permalink

Hello David,

Is there any API that will display a stack trace in a tool window that
also allows the user to click the line numbers and open the source
file in an editor?


Yes. You can create a console window with TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole()
and output text to it using the print() method. The hyperlinking functionality
will be supported automatically.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

I added this code:

ConsoleView view = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
view.print("error string", ConsoleViewContentType.ERROR_OUTPUT);


However, nothing ever displays.

Thank you,
David

0
Comment actions Permalink

Hello David,

I added this code:

+ConsoleView view =
TextConsoleBuilderFactory.getInstance().createBuilder(project).getCons
ole(); view.print("error string",
ConsoleViewContentType.ERROR_OUTPUT);+

However, nothing ever displays.


Did you add the console to a toolwindow? This code snippet just creates a
console in memory, you won't see it anywhere.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.