I created .editorconfig
file at solution level in VS 2019 with following settings:
root = true
# All files
[*]
indent_style = tab
indent_size = 4
tab_width = 4
Then I restarted the IDE so the changes can take effect. However only .editorconfig
file itself uses the selected settings. All other files in my solution still use spaces and not settings defined in the config.
I then placed the .editorconfig
file at project level and restarted yet again. No change.
How do I properly use .editorconfig
file so all my project files use the settings defined in it?
Note: I am using latest version of VS 2019 Community.
According with documentation, you have to use "Format Document" or "Code cleanup" to apply the format to existing code.
When you add an EditorConfig file to your project in Visual Studio, new lines of code are formatted according to the EditorConfig settings. The formatting of existing code is not changed unless you run one of the following commands: