Visual Studio Code: highlighted imports in python

Viewed 1116

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.stack.imgur.com/oA1Y0.png

Ubuntu screenshot, how it currently is:

https://i.stack.imgur.com/33WqC.png

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

Thanks!

2 Answers

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

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.

Related