Customizing syntax highlighting in Visual Studio Code

前端 未结 4 1297
旧巷少年郎
旧巷少年郎 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:42

    Syntax highlighting rules are stored in .plist files (or alternatively in .tmLanguage files). In those files different token types are declared for syntax highlighting:

    • What is a keyword?
    • What is a string literal?
    • What is a comment?
    • etc.

    Take a look here to get more information about it: https://code.visualstudio.com/Docs/customization/colorizer

    You do not define colors in .plist files!

    The relation between token types and colors is done in color theme declarations.

    Learn more about it here https://code.visualstudio.com/Docs/customization/themes and here How to add theme in Visual Studio Code?

    In general this document is also helpful when you try to extend VSCode: https://code.visualstudio.com/docs/extensionAPI/overview

提交回复
热议问题