Stack trace hyperlink to source file

How do I plugin my language into IJ so that stack trace elements in the console involving my language are hyperlinked?

Scott

3 comments
Comment actions Permalink

Hi Scott,

There is a target method defined at console interface - 'com.intellij.execution.ui.ConsoleView.printHyperlink()'. Feel free to check IDEA sources for examples on how it's used.

Regards, Denis

0
Comment actions Permalink

Thanks.  What I'm after, specifically, is to somehow intercept or provide a plugin hook to make IJ print stack traces with hyperlinks where my language is involved.  After wading through the IJ code it appears that maybe ConsoleFilterProvider is what I'm after. I'll give that a try.

Scott

0
Comment actions Permalink

To follow up, I implemented the ConsoleFilterProviderEx interface with a "consoleFilterProvider" extension.  And then implemented com.intellij.execution.filters.Filter by modifying a copy/paste of intellij's DefaultExceptionFilter.Since there is some overlap in the purpose of the this interface and the PositionManager one, I factored out some code from my position manager.  For basic langauge support it seems like JetBrains could factor out a simpler interface to automatically handle both of these features (PositionManager and ConsoleFilterProvider). Just a thought.

On a side note I was expecting the GlobalSearchScope parameter to the ConsoleFilterProviderEx#getDefaultFilters() to be a ModuleRuntimeClasspathScope i.e., would be rooted at the module specified in the run configuration. But its' a full ProjectAndLibrariesScope.  Seems useless. Just my observation.

Scott

0

Please sign in to leave a comment.