I’m having a problem with VSCode and syntax coloring.
Image 1
I have these imports but VSCode won’t turn them green even though code itself is working fine.
When I drag my main code and modules to workspace VSCode founds the imports and turns them green.
Image 2
How am I able to make my imports turn green without my modules being on workspace?
I want to start my code straight from my desktop.
There must be somekind of path problem but I don’t know how to solve this.
I uninstalled and reinstalled Python and VSCode.
I deleted AppData/Roaming/Code files and .vscode extensions files.
These didn’t work.
2
Answers
I wanted to post that I got this problem fixed (if someone is struggling with the same issue..)
I downloaded previous Pylance version >>> v2023.3.21
Now my all modules are working just like they should (also when I run my code straight from the desktop).
Update: Fixed with Pylance 2023.4.11 pre-release version. Github issue closed
Many people experience the same issue (including myself);
Workarounds would be;