Does anyone know what could cause VS Code to suddenly have syntax highlighting go haywire, and autocompletion/intellisense stop working? I have tried reinstalling VS Code, switching to the VS Code insiders version, disabling unused extensions. No matter what I do a few minutes after opening VS code highlighting goes nuts and Pylance intellisense drops out.
For example:
The only unusual thing I see in the language server output is:
2023-08-10 09:35:08.006 [info] Error: Debug Failure. False expression: Chained file path undefined doesn't match cellFilePaths c:\Users\julian.irwin\OneDrive - Thermo Fisher Scientific\Projects\XXXX\python notebooks\xxxxxxxxx\lamp_noise_study.ipynb:pylance-notebook-cell:X15sZmlsZQ==.py
at _0x2f5209 (c:\Users\julian.irwin\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.8.20\dist\server.bundle.js:1:1017323)
at c:\Users\julian.irwin\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.8.20\dist\server.bundle.js:1:1024550
at _0x3100be.<computed> (c:\Users\julian.irwin\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.8.20\dist\server.bundle.js:1:1024582)
at _0x72f7ac._onDidChangeNotebookDocumentAsync (c:\Users\julian.irwin\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.8.20\dist\server.bundle.js:1:1003431)
Much of the language server output has path names containing sensitive information so I didn't post the full output. I can scrub and then post them if it would help someone debug this.
Another mysterious fact is that a python file (.py) opened in a different tab works fine. Highlighting and autocompletion are fully function. It is only in the notebook environment that the problem occurs.
Possibly related to this Pylance issue: https://github.com/microsoft/pylance-release/issues/4685
Suggested solution is to downgrade to Pylance v2023.7.40
Versions:
windows 11
vscode 1.81.0
vscode 1.82.0-insider (also tried with this one!)
python 3.11.1
ipykernel 6.19.4
VSCode Extensions
Jupyter v2023.7.1002162226
Python v2023.14.0
Pylance v2023.8.20