Customizing syntax highlighting in Visual Studio Code

前端 未结 4 1295
旧巷少年郎
旧巷少年郎 2020-12-05 10:26

I\'m currently trying to write an extension for a new file type (ANTLR) and wonder how to change the colors used for syntax highlighting in Visual Studio Code. To me it look

4条回答
  •  离开以前
    2020-12-05 10:43

    You might consider using a color theme

    Since VSCode 1.44 (March 2020), you now have

    Theme Support for Semantic Tokens

    Color themes can now write rules to color semantic tokens reported by language extensions like TypeScript.

    "semanticHighlighting": true,
    "semanticTokenColors": {
        "variable.declaration.readonly:java": { "foreground": "#00ff00" "fontStyle": "bold" }
    }
    

    The rule above defines that all declarations of readonly variables in Java shoud be colored greed and bold

    See the Semantic Highlighting Wiki Page for more information.

提交回复
热议问题