Edit: Pylance seems to be much better at this and has so far resolved all problems with the previous Python language server from Microsoft.
I\'m using VS Code an
It turned out it was a particular VS Code extension for me.
Angular Language Service. Disabling this made it lightning quick.
Try this to see if it is a particular extension.