rtert
rtert

Reputation: 51

Visual Studio Code: highlighted imports in python

I use Visual Studio Code both on my work Windows laptop, and on my Ubuntu PC at home.

There's a functionality that I can see from my Windows vscode that I'd like to have on my Ubuntu one as well, but can't find whether it's a setting, extension, or something else.

The functionality is this: python imports are highlighted in green, and if they are not used, they are dimmed.

Windows screenshot, how I want it to work:

https://i.sstatic.net/oA1Y0.png

Ubuntu screenshot, how it currently is:

https://i.sstatic.net/33WqC.png

Does anyone know where I should look? I'm using the same colour theme on both, Monokai.

Thanks!

Upvotes: 4

Views: 6535

Answers (4)

Eric Pedley
Eric Pedley

Reputation: 223

For me the fix was running Developer: Restart Extension Host from the command palette (ctrl+shift+p)

Upvotes: 0

tsaebeht
tsaebeht

Reputation: 1680

As @Łukasz Kwieciński mentions in his comment, the solution was Pylance. Installing Pylance and restarting the VSCode issue fixed the issue

Upvotes: -1

rtert
rtert

Reputation: 51

I fixed it by installing the extension Settings Sync and syncing settings and extensions of my two installations. If it was an extension indeed, it probably was fixed by removing the Python Extension Pack and installing Python for VSCode.

Upvotes: 1

Guillermo Brachetta
Guillermo Brachetta

Reputation: 4775

You will get the linting warnings by pip installing flake8.

You also need to add this setting to your settings.json file:

"python.linting.flake8Enabled": true

Upvotes: 0

Related Questions