Messed up C# formatting in Visual Studio Code?

Ensure dotnet is installed.

On macOS:

Close and open Visual Studio Code after that. If that doesn’t help close and open the file in question too.

If that doesn’t help, Google. ๐Ÿ˜ƒ

C# on Visual Studio Code seems to be a bit finicky. Even after the above, sometimes I’ll open a file and the colours aren’t correct. Close and open and it looks fine. Weird.