clutcher / bh

Issue tracker for Better Highlights Intellij IDEA plugin
7 stars 0 forks source link

Better Highlights' Annotator "Problems" are inseparable from authentic "Problems" #89

Closed ipointer-netrise closed 9 months ago

ipointer-netrise commented 9 months ago

There doesn't seem to be a way to separate the "Better Highlights" mechanism from actual inspection errors. Perhaps Better Highlights can use and set its own inspection, instead of reusing the "Annotator" one?

Is there another way around this?

image

clutcher commented 9 months ago

@ipointer-netrise Wow, impressing investigation... Thanks for such deep analysis.

Annotator is an only available and recommended way to add any highlighting, so I can't use anything else. Most probably the issue is in "highlight severity" level, but they are different between IDEs and languages. For example in Intellij IDEA with Java highlighted comments are not displayed in list of issues, while in Rider with C# it was displayed in list of errors (until I fixed it few month ago).

ipointer-netrise commented 9 months ago

I just saw the new feature release - was this in response to this bug? I'm impressed!

As for your questions:

//! Execute

//! Verify


  * In short, any and all highlights do this - one per line.
* I am a licensed user (under a different email, my personal email - I'm logged in with my work email now).  Thank you!

I'll report back shortly if the new update solves it for me.
ipointer-netrise commented 9 months ago

Without playing with any of the new settings, the issue is still there - I'll play around and find out:

image

clutcher commented 9 months ago

@ipointer-netrise Not for that bug) for various set of issues, where root cause is that people just need a different levels of highlighting for different use cases.

Cna you try to change highlight level to "syntax", I would expect it to fix your problem (on paid account, otherwise it will not have effect)? If not - I'll take a look on what's going on in GoLand.

2023-12-18_19-41-06

clutcher commented 9 months ago

@ipointer-netrise Just checked with latest version and don't see any issues on new empty project. Maybe I need to configure something else to reproduce the issue.

2023-12-18_20-02-20

ipointer-netrise commented 9 months ago

@clutcher Changing to SYNTAX worked! I'm curious, what is the different between SYNTAX and TEXT? I'm an old Java developer, so I know the symbols are compiled differently there, and this kind-of makes sense from that perspective; but what does this mean for a compiled language, like golang?

I'm trying to think of other configurations I may have which may be causing these to show like that.

Perhaps it's something with the way my default inspections are set up? I've exported my inspection settings, in case that provides any insight.

Inspections_Project_Default.xml.zip

clutcher commented 9 months ago

@ipointer-netrise Great that it worked for you. I'll check your inspection settings. Are you using some external code analyzer or linter (like sonar qube) connected to GoLand?

P.S.: That severity level is part of intellij, which is sort of layer level (or prioroity of highlighting). I think the closest analogue would be z-index in css. So basically any highlighting in intellij has severity level. During renderind in editor highlighting is applied one by one ordered by that severity. You can see list of standard severities here - HighlightSeverity.

The bad things are that HighlightSeverity is highly coupled with inspections, which means that you can't just create a new instance of HihglightSeverity with custom defined level as it would lead to various bugs in random places like #55, #69 etc. + it still doesn't cover all the cases even with max int severity, because of additional filtering by some special instances of severity level or just skipping highlighting.

At the end I decided to stop using custom highlight severity and switch on out of the box ones + give user abitility to choose what they need.

P.P.S.: Text, Warn and Error are standard out of the box severity, which you can find in file I mentioned above. Syntax is more tricky as I resolved it in runtime based on current IDE/language, at the end it uses same severity as intellij is using for low syntax highlighting executed during lexer analysis of source code. In case of GoLand it woudl be SYMBOL_TYPE_SEVERITY

ipointer-netrise commented 9 months ago

Thank you!

The CSS reference was 💯

I'm satisfied! I'm not sure if you want to keep this issue open - as it may not be intuitive for other GoLand users, or if you want to do anything else with this, but as for me, this "workaround" (if I can call it that), does what I need it to.

If I were in your position, I might just change the "default" for new entries to be SYNTAX if the IDE is GoLand.

Thanks again! I'm quite happy I've supported the plugin!

P.S. I just wish IntelliJ would support font size adjustments - something I know isn't supported architecturally/technically. To be clear: I know this is an IntelliJ issue, and nothing you can control via the plugin.

clutcher commented 9 months ago

@ipointer-netrise I will keep ticket open for some time, I want to understand why TEXT is not working in GoLand, as it is supposed to work (and basically works as expected in my tests). SYNTAX - have it's own sideeffects, so I'm not sure that it is a good idea for default.

P.S. Yeah.. size adjustment is a pain, a lot of people requested it, but I didn't found even workaround ways to do it. Maybe I'll take some time next year to go deeply in editor rendering and maybe will found something there, what coudl be used with reflection or other magic.

clutcher commented 9 months ago

@ipointer-netrise So with your settings I still can't reproduce issue. If you would use WARN in latest version of plugin, would it be displayed as warning instead of error and contain some text in message?