javavisual-studio-code

Strange Java highlighting in VS Code


The highlighting for my .java files in VS code is very strange. I did not have this issue until recently, although I cannot think of any changes I made or new extensions I installed.

strange highlighting

I have all of the extensions from Microsoft's "Extension Pack for Java":

I tried restarting the program as well as uninstalling and reinstalling the extensions, to no avail. There are no preceding errors. Has anyone encountered this and found a fix?


Solution

  • A possible solution for your case as mentioned here and here can be:

    1. Open setting and search for "Semantic Highlighting"
    2. By default it has the value configuredByTheme. Set it to false

    Another possible solution will be to change the theme you are using.

    For more information you can read the following: