I have a set of .sql scripts in a project I am working on which currently contain a mix of tabs and spaces for indentation. I would like to find a method which will automatically and transparently convert these tabs to spaces on file save. It would be great if the auto formatting worked in both VS Code AND Visual Studio.
I have tried an EditorConfig (.editorconfig) file like so:
root = true
# Enforce 4 space indenting and NO tabs in SQL script files
[*.sql]
end_of_line = crlf
indent_size = 4
indent_style = space
but it doesnt seem to work. Even when I try the manual "Format Document" option in either VS Code or Visual Studio, nothing happens. I also tried to set up the Prettier VS Code extension but I couldnt get that to work either.
First of all, is this possible using EditorConfig and if not, how can I go about achieving this?