Is there a way to hide annotations in Netbeans or Eclipse?

Maybe a dumb question, but it would be nice if there was a way to hide or collapse Java annotations when viewing the source in Netbeans (or Eclipse). I do not find an option, and a quick search did not turn anything.

Is this one of those, “You should never do this, folding code is a sin!” things?

Personally, I find this useful for annotated entity classes. All hibernate / etc annotations are just fluff that I never watch as soon as my display works fine. It looks like an import, really.

(Yes, I can use XML instead of annotations, which I could start to do, but I'm just wondering ...)

+3
source share
2 answers

Using only Eclipse or IDEA, I don't know about any IDE options to hide annotations, and in my opinion, this is good.

Your annotations affect how the code is compiled, and often how it works. In my opinion, hiding them is tantamount to hiding keywords public/ protected/ privatein method signatures or any other language component. Their exclusion changes the meaning of their surrounding context and, consequently, the developer's expectations.

+3
source

Here's a good solution on how to "hide" @Nnotations. Make the @Annotations color a lighter color than the rest, for example, light green.

: : Java > p > "" "". . : . RGB: 0, 240, 0 : -: RGB: 0, 170, 80

, , , . @Annotations, , , . =. ? no es muy inteligente. -

+4

Source: https://habr.com/ru/post/1706250/