-
Notifications
You must be signed in to change notification settings - Fork 23
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
Support for Semantic highlighting for Java? #19
Comments
Thanks for your suggestion, I don't even know this feature until you said it. I'll add support for the semantic highlighting in these days. |
I tried semantic highlighting, it works very well in typescript and javascript, but I can't figure out how to enable it in java and C++. You can try to press Ctrl+Shift+P to open command panel and search for "Inspect Editor Tokens and Scopes". If the semantic highlighting of java is successfully enabled, then you can see a new section that shows semantic token type. This section does not appear when I open a java file(nor C++ file). |
I was able to enable it using this setting: "editor.tokenColorCustomizations": {
"[Gruvbox Material Dark]": {
"semanticHighlighting": true
}
} Found this info from here - https://github.com/microsoft/vscode/wiki/Semantic-Highlighting-Overview#which-themes-offer-semantic-highlighting This changed highlighting a lot and I didn't like it. Too much green and yellow. So I turned it off for now. |
That's exactly why I'm going to optimize these file types 671033f. I added a new option to determine whether to enable semantic highlighting which is true by default, maybe I should set it to false by default. |
I think you should not add one more flag to enable semantic highlighting in the theme. There are already 2 flags, one at editor level and one at the language level. You should check if you can provide semantic highlighting for the current language and provide highlights based on that. Just my 2 cents. |
Thanks for your suggestion. To be honest, I have carefully thought about this question previously, because there're already many options and too many options may confuse users. My conclusion is that it's necessary to add an option to enable or disable semantic highlighting, because there're some potential problems in this feature. One of them is what you have mentioned above: the semantic highlighting in some languages like java may look bad, and what's worse is that this feature is enabled by default in some languages (js, ts and c++). Another problem is that even if the support of this feature is good in some languages, there will still be some problems, for example vscode#92308. In fact, "add an option" itself is not the key to the problem, the key is how not to confuse users. I'll add an FAQ and mention it in the description of this option in user settings. |
I agree about your reasoning, just don't agree with the solution. Users can still disable semantic highlighting at the editor level. There's no point keeping that option on at editor level and disable at theme level. Theme can utilize the same option and users still have a way to enable disable this feature. |
The semantic highlighting is not an editor level option, it's a theme level option. According to the official docs, a theme can enable semantic highlighting by adding this line in What you've done is actually overriding it in user settings. "editor.tokenColorCustomizations": {
"[Gruvbox Material Dark]": {
"semanticHighlighting": true
}
} Maybe you think this option is editor level because the java extension provides an option to toggle whether to enable it, but this extension is actually interfering with theme level options. The JavaScript and TypeScript extensions officially developed by Microsoft do not provide corresponding options to enable or disable semantic level highlighting(at least I don't find it), and the official guide of TypeScript says:
So I keep my point, whether to enable semantic highlighting should be controlled on the theme level. |
You are right. I didn't see it previously, thanks for your notice. I am now confused about which level of option it is, but it doesn't matter. If there is already an option to control it globally, then I think it's unnecessary to add a new option any more. I'll remove it. Thanks again :) |
v6.2.0 is now available on the marketplace. |
Thanks. Works great with colorful syntax mode disabled. Will it improve on it's own as Java extension provides more semantic information? |
Hi,
Is there any plan for supporting Semantic highlighting for Java?
vscode-java
extension provides token rules that can be used by themes to highlight different variables based on their semantics.https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting
The text was updated successfully, but these errors were encountered: