How do I change color of comments in visual studio code?

后端 未结 9 2263
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 10:29

I went through https://code.visualstudio.com/docs/getstarted/theme-color-reference but can\'t seem to find the setting for changing the comment color.

I am currentl

9条回答
  •  渐次进展
    2020-11-27 11:13

    From 1.15 (July 2017) you can change it from settings.json Ctrl+,

    "editor.tokenColorCustomizations": {
        "comments": "#d4922f"
    },
    

    From 1.20 (January 2018) you can also do it for each theme separately:

    "editor.tokenColorCustomizations": {
        "[Atom One Dark]": {
            "comments": "#d4922f"
        }
    },
    

    Finding the right scope:

    Developer: Inspect TM Scopes editor.action.inspectTMScopes

    Selector priority:

    https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations#_textmate-themes



    Ok, more examples (for js):

    "editor.tokenColorCustomizations": {
        "textMateRules": [{
            "scope": "INSERT_SCOPE_HERE",
            "settings": {
                "foreground": "#ff0000"
            }
        }]
    }
    

    comment punctuation.definition.comment comment.block.documentation storage.type.class.jsdoc entity.name.type.instance.jsdoc variable.other.jsdoc

提交回复
热议问题