2021.1.3
0.19.0
I have the Svelte IDEA plugin installed and it keeps trying to indent everything with 2 spaces, instead of 4 spaces (the rest of the project uses 4 spaces).
I can't figure out how to customise it.
File | Settings | Editor | Code Style
.editorconfig
file in my project sourceI could swear this thing was indenting consistent with the rest of the project just a few weeks ago, but now I'm not sure.
How do I tell IDEA to use 4 spaces for indenting Svelte files?
For me, the answer the was to turn off "detect and use existing file indents".
The indenting widget in the bottom right of the editor will tell you if IDEA has decided your file is "2 spaces" or "4 spaces". You can also use this widget to force re-indent to 4 spaces.
This auto-detection probably explains why IDEA suddenly started to behave differently. Maybe there was a change in a recent IDEA patch, or perhaps my project files changed through editing to trigger the algorithm into thinking the Svelte files were using 2 spaces for indenting.