New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a custom color for Java Annotations #6749
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for the added ability to customize annotation colors. But the colors itself might need some tweaks though ;)
I recommend to wait a bit till Neil is active again, he has a good eye for things like this I think.
I personally would probably prefer a desaturated version of the type modifier color.
here is a problem, annotations are tracked as identifier in the options if you click on it + preview doesn't use the right color:
put("mod-keyword", KEYWORD); | ||
//put("mod-keyword", KEYWORD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, not. I was trying to figure out what exactly it is used for. I'm still not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the semantic highlighter it would be mostly used from the parser info in module-info.java
files. But right now we do not parse that section of the code (in the semantic highlighter).
I've marked the PR as a preview to have a discussion on this. There are a few test and test data to be fixed according to the outcome of this discussion. Would it make sense to add coloring to the import statements? To me it also would make sense to have the |
@mbien The preview use the lexer only. I'm testing if I can add a highlighter there as well, that would come in a separate PR, if I can make that happen. |
be3810c
to
d0a512d
Compare
I'm doing some small work with Micronaut lately, and wished that the annotations would be more distinctive in the editor.
It seemed it is not that easy to set a different color for them. First the
@
and the...
tokens were marked asspecial
, though no coloring support were assigned to that key. I've checked the Lang Spec, they are called as separators (at least in 8).Also changing the color in the annotation use (or actually XXX Use) would make the import statements rainbow, so I had to skip those. Actually there is a possibility to use different colors for the imported identifiers, if someone would think that useful.
Lastly, added localization for the
mod-keyword
coloring. That is not in actual use as there are some bugs in the code. I do not know the correct intention of that modifier, How I'd get it that those are keywords that are keywords by their context, not a simple token in the Lexer.Ides, feedback are welcome!
This is with FlatLaf Light:
This is with FlatLaf Dark