anthraxx / intellij-awesome-console

IntelliJ IDEA plugin: awesome console finally makes links in your console at least 200% more awesome!
MIT License
159 stars 40 forks source link

File:line link in console can go to wrong source line when intellij collapses code lines #75

Closed NickCody closed 3 years ago

NickCody commented 3 years ago

IntelliJ can collapse parts of the source file and as a result, Awesome console will go to the wrong line for source files that have some collapsed lines. Collapsed lines can be collapsed imports, collapsed function definitions, etc.

Awesome console seems to go to the "literal" editor buffer line number, rather than the true line number which shows in the gutter.

anthraxx commented 3 years ago

I don't think the API offers a way to go to the "native" line number unfortunately. All that the API seems to offer is a virtual file with specified line and column, which we add. Unfortunate

NickCody commented 3 years ago

Gotcha. I can work around this. Thanks for your speedy response, Levente.

jlous commented 3 years ago

Editor.logicalToVisualPosition should be be helpful for calculating the correct line