-
Notifications
You must be signed in to change notification settings - Fork 431
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
Syntax highlighting changes #3641
Comments
Our java.tmLanguage.json is directly copied into vscode. See https://github.com/microsoft/vscode/blob/facea7e2c298bc0e9fcb553464cd7fc7d4b519e0/extensions/java/syntaxes/java.tmLanguage.json#L2-L6 . Doing a quick comparison the only difference is in the The difference probably comes from semantic highlighting, which is an extra layer of highlighting done by the language server itself, since it collects even more information about the source file. Are you using the dark theme ? I noticed a difference on the Screencast.from.2024-05-06.11-03-58.webmScreencast.from.2024-05-06.11-04-57.webm |
You can try this in your vscode settings: "[java]": {
"editor.semanticHighlighting.enabled": false
} |
I checked the token and scope and it's exactly the same for a variable and a constant variable which results in the syntax highlight being the same for both (I presume) |
Do you have a sample project / snippet of code you're able to share that produces this ? Is there anything in your error logs that indicate a failure to start the language server ? The popup you're showing doesn't contain any information about the semantic tokens at all, which would indicate you don't have a language server started. Here's what it looks like when the language server is running : |
I restarted the Java Language Server via the command-palette and this is the log. I don't see anything that might indicate something went wrong
But something interesting did happen Ultimately, i'll only have a Java 17 branch. So pretty sure this issue will be resolved then (the switching back and forth probably messed up the language server ?) |
@realqpat is the project available somewhere public ? Are you able to share it ? I don't mind seeing if switching branches (effectively changing build configurations) causes some issues for the language server. |
Switching is not the actual solution. I've actually narrowed it down This has been my workaround for now. Restart the Language Server when I face the issue. |
Seems like the syntax highlighting has changed recently. I've noticed it with the constant variables
They are highlighted the same as a regular variable now
When opening a java file, the syntax highlight is correct and a few seconds later it changes
When checking the developer tools, I noticed the following that seems related but not sure
Is there a way to keep the old grammar file ?
Environment
The text was updated successfully, but these errors were encountered: