1

I am learning python and I am using visual studio code for it.

I have an office laptop and a personal laptop. When I define any variable in my office laptop the color of the variable is White.

But when I open the same python file the color of the variable is colored (blue color).

I have selected the same theme in both laptops and extensions are also the same. I don't know which setting should I change so the variable name will be colored.

Here is the screenshot of my code and extension installed. You can see that number_a, number_b and sum_a_b are visible in white color.

Can anyone please help me to fix this? Thanks

enter image description here

rioV8
  • 24,506
  • 3
  • 32
  • 49

1 Answers1

0

Despite customizing syntax highlighting in Settings.json as @help said, Python extension itself has this feature that highlight variables.

You may reset VS Code to solve the variables wasn't highlighted correctly in your laptop. Delete the data folders and reinstall Python extension, the question should be fixed:

Windows - Delete %APPDATA%\Code and %USERPROFILE%\.vscode.
macOS - Delete $HOME/Library/Application Support/Code and ~/.vscode.
Linux - Delete $HOME/.config/Code and ~/.vscode.

Molly Wang-MSFT
  • 7,943
  • 2
  • 9
  • 22