Uncategorized

visual studio code – Vscode python highlighting(Pylance) not working in certain folder


I’m encountering a peculiar issue with VSCode’s Python syntax highlighting. I use remote ssh to access these workspace. It works fine in some workspaces but fails in others. In the attached screenshots of two different workspaces opened simultaneously, you can see the noticeable differences. Not only does syntax highlighting not work, but the ‘Command + Click’ for definition navigation is also malfunctioning (it shows ‘loading’ and then freezes). No error messages are displayed, leading me to suspect an issue with Pylance. Some answers suggest that I could fix this by changing the language server to Pylance, but it’s not working.

besides, my folder is like A_folder/B_folder/C_folder, and if I set the workspace to be C folder, the autohighlighting works, and it fails in A_folder or B_folder.

not working
working

Attempts to resolve this have included:

Replicating the issue on a different computer using VSCode SSH to access these workspaces (shared remote drive).
Setting the language server to Pylance for user, remote, and workspace settings instead of the default.
Reinstalling the latest version of VSCode.
Uninstalling and reinstalling Python or Pylance extensions in VSCode.
Restarting the computer.
Using “workspace cache clean” extension to clean the cache.
None of these steps have resolved the issue. Any insights or suggestions would be appreciated.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *