apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.64k stars 849 forks source link

Fix use-instanceof-pattern hint messages #7573

Closed mbien closed 3 months ago

mbien commented 3 months ago

Some components render as html which made the text inside the angle brackets disappear. This caused confusing "use instanceof" hints, marking lines which already used instanceof.

Now it reads "use instanceof pattern" as it was intended.

image

sdedic commented 3 months ago

Two ideas, posisbly bad/broken, but anyway:

mbien commented 3 months ago

@sdedic tbh my first instinct was to escape the brackets, its just that it reads perfectly fine without them. It is an "instanceof pattern" after all.

I wouldn't escape html somewhere deeper in the logic since html rendering is super common within NB, some hints will likely make use of it - I haven't checked.

Also next week might be already feature freeze and I have a lot of unreviewed PRs open already, I am about to open another quick fix in a moment.

sdedic commented 3 months ago

@mbien agreed ... I've checked editor hints ui impl in the meantime and the html support is deliberate, text taken directly from Fix.getText(). Although the html interpretation is undocumented, changing this would be incompatible ...

agree with the readability; thanks for the explanation