jshiell / checkstyle-idea

CheckStyle plug-in for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Other
884 stars 160 forks source link

editor doesn't provide tooltips for javadoc problems #181

Open Kidlike opened 9 years ago

Kidlike commented 9 years ago

Hi,

With real-time scan enabled, when there's a checkstyle problem, there's no information of what that problem is. You can only see the visual indication in the editor.

Could someone add a tooltip when you mouse-over or pressing ctrl+f1 on warnings, as per the usual intellij behavior ?

The tooltip should have a prefix indicating that it's coming from checkstyles (like jshint and scss-lint), and the checkstyle problem message.

Thanks !

Kidlike commented 9 years ago

After using this for a while I realized that my description only applies on javadocs.

If there's a problem with the javadoc there's no tooltip. Java code problems have proper tooltips; although without the checkstyle prefix, which I personally believe should be the case.

jshiell commented 9 years ago

Prefixes are a fair request - I've added them.

As for the tooltips, it's much messier than just javadocs I fear. This is all caused by a combination of where IDEA is willing to display tooltips, and how we map Checkstyle errors to IDEA parse nodes.

Checkstyle reports errors on a character/line basis. IntelliJ cares not for such trivia - instead, it has a parsed tree of PsiElements that represent the structure of the file. So we have to play silly buggers and try to map one form the other. As you've noticed, it's not always perfect, and what we have is the least-worst combination of trade offs I managed to find.

This is further complicated as IDEA seems picky about displaying tooltips. Where a node doesn't map directly (e.g. where the indentation is wrong) it helpfully displays an error marker in the code, but (certainly on OS X) doesn't seem to like displaying the tooltip on that. Although in some cases it displays the tooltip on the character in front of the error marker.

The long and short of it is I'm very wary of changing this parsing for fear of breaking more than I fix. So I fear it's unlikely to change without a complete revisiting of the parsing code. Sorry.

Kidlike commented 9 years ago

I see.

If I find time in the future I will revisit this myself. I have some small experience with this IntelliJ Psi logic; albeit not much :)

Thanks for the prefix.

Do you have a backlog tag to put this under ?

jshiell commented 9 years ago

The open issues list is the backlog :smile: