VS Code Python circa v2023.9/v2023.10 has reduced syntax highlighting, no snippets, and suggestions are forever "Loading…"

Question:

I have a problem with Python using VS Code. When I ran VS Code Python file was light out (all common variables and all libraries was white). Also when I write some variable it doesn’t snippet (For example: I have the variable ‘download‘, so when I write ‘downl‘, VS Code doesn’t suggest me to use the variable ‘download‘ and doesn’t show me any other snippets). But when I open an ‘.html’ file, VS Code suggests me HTML snippets.

Text

after Reloading Without Pylance
Text

How to fix it, because when I Enable Pylance and reload – VS Code again wont suggest me snipets and it will be loading (Infinity loading variables and Python libraries)

Asked By: Морфей

||

Answers:

This might be a case of Pylance crashed immediately after open VSCode #5009, which is fixed in version 2023.10.53 (you’d need to switch to the pre-release channel). If you’re on a version at or above 2023.9.10, it might be Syntax highlighting and code completion stops working in v2023.9.10 onwards #5021. I’d suggest you check those issue tickets out and try to help out by contributing info about your environment.

Alternatively, you could try rolling back to an older version of the Pylance extension, or try toggling a Python-related setting, which apparently restarts the Python Language Service and causes the issue to go away for one VS Code session.

Answered By: starball