Indentation Style
Indentation is one of the most important aspects of formatting style — properly indented code will be readable even if other formatting is inconsistent. JetBrains Rider helps you configure and maintain proper indentation in many ways.
Sources of indentation settings
You can configure indentation style on the
page of JetBrains Rider settings Ctrl+Alt+S.If there are EditorConfig files that affect the current file, the indent_size
and indent_style
properties will override JetBrains Rider indentation settings. If you want JetBrains Rider to ignore EditorConfig styles, clear the corresponding checkbox on the page of JetBrains Rider settings.
Auto-detect indents
When you reformat a part of code in a file or when code is auto-formatted on editing or pasting, JetBrains Rider can calculate and apply indentation based on the existing indents in that file. You can enable or disable auto-detecting indents on the page of JetBrains Rider settings Ctrl+Alt+S.
Note that JetBrains Rider will NOT auto-detect indents if you reformat the whole file or multiple files, or if there are .editorconfig files that affect the current file.