Syntax highlighting not working for Python in VS Code with type annotations after reformatting Syntax highlighting not working for Python in VS Code with type annotations after reformatting python-3.x python-3.x

Syntax highlighting not working for Python in VS Code with type annotations after reformatting


Uninstalling the Python for VSCode extension fixed the issue.


This may be overkill, but I solved this problem on Linux Mint like this:

sudo apt purge codesudo apt autoremoverm -fR ~/.config/Codesudo apt install code

Then I installed the PyLance extension for rich highlighting.