Skip to content

Semantic Highlighting

Fred Bricon edited this page Nov 4, 2021 · 8 revisions

Semantic Highlighting is a new feature enabled since VS Code 1.43. Color themes can now write rules to color semantic tokens reported by this extension. If current color theme does not provide any, you can define your own rules in user settings, e.g.

"editor.semanticTokenColorCustomizations": {
    "rules": {
        "class": "#ff0000", // change color for tokens of type 'class'
        "*.constructor": "#f7c090", // change color for tokens of type '*.constructor'
        "parameter":{
            "foreground": "#00ff0d" // change color for tokens of type 'parameter'
        },
        "*.static":{
            "fontStyle": "italic" // all tokens with modifier 'static' should be of italic style
        },
        "*.readonly":{
            "fontStyle": "bold" // all tokens with modifier 'final' should be of bold style
        }
    }
}

More details in Semantic Highlighting Wiki Page (Token Styling).

Semantic Highlighting is controlled by the java.semanticHighlighting.enabled preference. When enabled, it fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience different small issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing.

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy