Syntax highlighting not working for Python in VS Code with type annotations after reformatting
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.