Loose indentation isn't caused by the IDE. It's caused by the coder. Loose indentation due to having spaces and tabs is often due to copying and pasting from multiple sources. Loose indentation when you're using all tabs or all spaces is due to the coder not indenting correctly.
For copy/pasting code, in VS Code, I can easily fix the spaces/tabs issue by selecting the entire code and then pressing TAB and then Shift+TAB. Any loose indentation due to poor coding should be fixed manually. This will help you learn how to 1) recognize it quicker and 2) get into the habit of doing it correctly the first time.