How can I disable italics in VSCode?

I'm writing some python script in VSCode, and I noticed that it's displaying function arguments text in italics

For example

enter image description here

I like the colour, but why is "key" written in italics? I searched all of VSCode settings and couldn't find it - maybe it's the Python extension that's doing this? But I couldn't find settings for that either


Solution 1:

Until VSCode adds that setting, the workaround is to add this to the settings.json:

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

That setting manually uses '' for the font-style on comments. Additional scopes may be required depending on where your theme uses italics.

Answer comes from this GitHub issue thread: https://github.com/Microsoft/vscode/issues/32579#issuecomment-813005373

Solution 2:

there is an issue open on Github with a workaround: https://github.com/Microsoft/vscode/issues/32579#issuecomment-341502559

You can be more granular and narrow down the list of scopes if you know which one you want to change. To get the list of scopes use "Developer: Inspect Editor tokens and scopes" from the Command Palette (Ctrl+Shift+p)

Screenshot of Textmate Scopes

Solution 3:

If you are using an extension for the theme in vscode. Then follow these steps.

  • Ctrl/cmd + shift + x -> search extension eg one dark pro.

enter image description here

  • Click the settings icon and select Extension settings.

enter image description here

  • Toggle italics.

enter image description here

  • Reload your window.