Continuing my transformation of my development environment to match Wes Bos’, today I discovered from a Stack Overflow answer how to change how comments in any language are rendered in VS Code.

It turns out that there is a setting to control it, it’s just deeply nested. The necessary snippet for user settings is:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "comment",
            "settings": {
                "fontStyle": "italic"
            }
        }
    ]
}

(You can access user settings under “Code > Preferences > Settings” on Mac).

Screenshot demo of italic comments

It turns out that VS Code is yet another editor to support themes and colour highlighting rules in TextMate format. Once we’re into the correct setting context, it’s just a case of targeting the "comment" scope and instructing the editor to render comments in italic. This should work for a bunch of other style properties as well, if there are other adjustments you’d like to make.