MMachado
MMachado

Reputation: 88

VSCode Python - Code with strange color format

after reinstall my VSCode I have a problem with the way VSCode handles color highlights.

For example, sometimes when I comment some code, they stay white instead of green. Sometimes function definition stays white too.

Check this example:

enter image description here

Anyone have any tip to fix this?

I already tryed to reinstal VSCode again but don't fix anything. I have latest version (1.55.1)

Upvotes: 0

Views: 2034

Answers (1)

Joy
Joy

Reputation: 241

Check the Python extension you installed. This one should be sufficient from the start. Remove other related extensions to see if there are any conflicts.

Otherwise, maybe try to specify the color theme. Go to Command Palette (⇧⌘P) with Preferences: Open Settings (JSON), and add the below snippet:

"workbench.colorTheme": "Default Dark+"

Save it and see if the color has changed in the file.

If still not working, try to set the color for comment and function call manually.

At the same settings.json, add the below snippet. You can change the hex color whatever you like:

"editor.tokenColorCustomizations": {
    "comments": "#608b4e",
    "functions": "#d3d793"
}

Save it and the color will be overriden from now on.

More info, please see here: https://code.visualstudio.com/docs/getstarted/themes

Upvotes: 2

Related Questions