Rider Help

C# - Other

Indentation

Continuous line indent multiplier

Property names:

[resharper_]csharp_continuous_indent_multiplier, [resharper_]continuous_indent_multiplier

Possible values:

an integer

Examples:

value: 0
int·foo1()·+ foo2();
value: 1
int·foo1()·+ ····foo2();
value: 2
int·foo1()·+ ········foo2();

Indent "case" from "switch"

Property names:

csharp_indent_switch_labels, indent_switch_labels

Possible values:

true | false

Examples:

true
switch·(expression) { ····case·0: ········break; }
false
switch·(expression) { case·0: ····break; }

Indent nested "using" statements

Property names:

[resharper_]csharp_indent_nested_usings_stmt, [resharper_]indent_nested_usings_stmt

Possible values:

true | false

Examples:

true
using·(new·A()) ····using·(new·B()) ········using·(new·C()) ········{ ············foo(); ········}
false
using·(new·A()) using·(new·B()) using·(new·C()) { ····foo(); }

Indent nested "fixed" statements

Property names:

[resharper_]csharp_indent_nested_fixed_stmt, [resharper_]indent_nested_fixed_stmt

Possible values:

true | false

Examples:

true
fixed·(int&x) ····fixed·(int&y) ········fixed·(int&z) ········{ ············foo(); ········}
false
fixed·(int&x) fixed·(int&y) fixed·(int&z) { ····foo(); }

Indent nested "lock" statements

Property names:

[resharper_]csharp_indent_nested_lock_stmt, [resharper_]indent_nested_lock_stmt

Possible values:

true | false

Examples:

true
lock·(a) ····lock·(b) ········lock·(c) ········{ ············foo(); ········}
false
lock·(a) lock·(b) lock·(c) { ····foo(); }

Indent nested "for" statements

Property names:

[resharper_]csharp_indent_nested_for_stmt, [resharper_]indent_nested_for_stmt

Possible values:

true | false

Examples:

true
for·(int·0xa++) ····for·(int·0yb++) ········for·(int·0yc++) ········{ ············foo(); ········}
false
for·(int·0xa++) for·(int·0yb++) for·(int·0yc++) { ····foo(); }

Indent nested "foreach" statements

Property names:

[resharper_]csharp_indent_nested_foreach_stmt, [resharper_]indent_nested_foreach_stmt

Possible values:

true | false

Examples:

true
foreach·(var·in·x) ····foreach·(var·in·y) ········foreach·(var·in·z) ········{ ············foo(); ········}
false
foreach·(var·in·x) foreach·(var·in·y) foreach·(var·in·z) { ····foo(); }

Indent nested "while" statements

Property names:

[resharper_]csharp_indent_nested_while_stmt, [resharper_]indent_nested_while_stmt

Possible values:

true | false

Examples:

true
while·(a) ····while·(b) ········while·(c) ········{ ············foo(); ········}
false
while·(a) while·(b) while·(c) { ····foo(); }

Indent type constraints

Property names:

[resharper_]csharp_indent_type_constraints, [resharper_]indent_type_constraints

Possible values:

true | false

Examples:

true
class·C1<T1> ····where·T1·I1 { }
false
class·C1<T1> where·T1·I1 { }

Don't indent comments started at first column

Property names:

[resharper_]csharp_stick_comment, [resharper_]stick_comment

Possible values:

true | false

Examples:

Before formatting After formatting, true
namespace·{ //·Some·comment ··class·{ ··} }
namespace·N { //·Some·comment ····class·C ····{ ····} }
Before formatting After formatting, false
namespace·{ //·Some·comment ··class·{ ··} }
namespace·N { ····//·Some·comment ····class·C ····{ ····} }

Indent method declarations' parenthesis

Property names:

[resharper_]csharp_indent_method_decl_pars, [resharper_]indent_method_decl_pars

Possible values:

  • outside_and_inside: Parenthesis 1x, inside 2x (GNU style)
  • none: No indent
  • inside: Inside parenthesis (BSD/K&R style)
  • outside: Parenthesis and inside equally (Whitesmiths style)

Examples:

outside_and_inside
void·Method( ········int·parameter1, ········int·parameter2 ····);
none
void·Method( int·parameter1, int·parameter2 );
inside
void·Method( ····int·parameter1, ····int·parameter2 );
outside
void·Method( ····int·parameter1, ····int·parameter2 ····);

Indent method calls' parenthesis

Property names:

[resharper_]csharp_indent_invocation_pars, [resharper_]indent_invocation_pars

Possible values:

  • outside_and_inside: Parenthesis 1x, inside 2x (GNU style)
  • none: No indent
  • inside: Inside parenthesis (BSD/K&R style)
  • outside: Parenthesis and inside equally (Whitesmiths style)

Examples:

outside_and_inside
var·Method( ········parameter1, ········parameter2 ····);
none
var·Method( parameter1, parameter2 );
inside
var·Method( ····parameter1, ····parameter2 );
outside
var·Method( ····parameter1, ····parameter2 ····);

Indent statement (if, while, for, etc) parenthesis

Property names:

[resharper_]csharp_indent_statement_pars, [resharper_]indent_statement_pars

Possible values:

  • outside_and_inside: Parenthesis 1x, inside 2x (GNU style)
  • none: No indent
  • inside: Inside parenthesis (BSD/K&R style)
  • outside: Parenthesis and inside equally (Whitesmiths style)

Examples:

outside_and_inside
if·( ········condition1·&& ········condition2 ····) ····return;
none
if·( condition1·&& condition2 ) ····return;
inside
if·( ····condition1·&& ····condition2 ) ····return;
outside
if·( ····condition1·&& ····condition2 ····) ····return;

Indent type parameter's angles

Property names:

[resharper_]csharp_indent_typeparam_angles, [resharper_]indent_typeparam_angles

Possible values:

  • outside_and_inside: Parenthesis 1x, inside 2x (GNU style)
  • none: No indent
  • inside: Inside parenthesis (BSD/K&R style)
  • outside: Parenthesis and inside equally (Whitesmiths style)

Examples:

outside_and_inside
void·Method< ········T1, ········T2 ····>();
none
void·Method< T1, T2 >();
inside
void·Method< ····T1, ····T2 >();
outside
void·Method< ····T1, ····T2 ····>();

Indent type argument's angles

Property names:

[resharper_]csharp_indent_typearg_angles, [resharper_]indent_typearg_angles

Possible values:

  • outside_and_inside: Parenthesis 1x, inside 2x (GNU style)
  • none: No indent
  • inside: Inside parenthesis (BSD/K&R style)
  • outside: Parenthesis and inside equally (Whitesmiths style)

Examples:

outside_and_inside
var·Method< ········Class1, ········Class2 ····>();
none
var·Method< Class1, Class2 >();
inside
var·Method< ····Class1, ····Class2 >();
outside
var·Method< ····Class1, ····Class2 ····>();

Indent other parenthesis and brackets

Property names:

[resharper_]csharp_indent_pars, [resharper_]indent_pars

Possible values:

  • outside_and_inside: Parenthesis 1x, inside 2x (GNU style)
  • none: No indent
  • inside: Inside parenthesis (BSD/K&R style)
  • outside: Parenthesis and inside equally (Whitesmiths style)

Examples:

outside_and_inside
var·checked( ················+ ················6 ············);
none
var·checked( ········+ ········6 ········);
inside
var·checked( ············+ ············6 ········);
outside
var·checked( ············+ ············6 ············);

Align Multiline Constructs

Method parameters

Property names:

[resharper_]csharp_align_multiline_parameter, [resharper_]align_multiline_parameter

Possible values:

true | false

Examples:

true
void·fooCall(int·firstParameter, ·············int·secondParameter) { }
false
void·fooCall(int·firstParameter, ····int·secondParameter) { }

First call arguments by '('

Property names:

[resharper_]csharp_align_first_arg_by_paren, [resharper_]align_first_arg_by_paren

Possible values:

true | false

Examples:

true
fooCall( ········firstParameter, ········secondParameter);
false
fooCall( ····firstParameter, ····secondParameter);

Call arguments

Property names:

[resharper_]csharp_align_multiline_argument, [resharper_]align_multiline_argument

Possible values:

true | false

Examples:

true
fooCall(firstParameter, ········secondParameter);
false
fooCall(firstParameter, ····secondParameter);

List of base classes and interfaces

Property names:

[resharper_]csharp_align_multiline_extends_list, [resharper_]align_multiline_extends_list

Possible values:

true | false

Examples:

true
class·BaseClass, ··········SomeInterface { }
false
class·BaseClass, ····SomeInterface { }

Expression

Property names:

[resharper_]csharp_align_multiline_expression, [resharper_]align_multiline_expression

Possible values:

true | false

Examples:

true
destination·source1 ··················source2 ··················source3;
false
destination·source1 ····source2 ····source3;

Chained binary expressions

Property names:

[resharper_]csharp_align_multiline_binary_expressions_chain, [resharper_]align_multiline_binary_expressions_chain

Possible values:

true | false

Examples:

true
var·someOperand·operand2 ········operand3 ········operand4
false
var·someOperand·operand2 ····operand3 ····operand4

Chained method calls

Property names:

[resharper_]csharp_align_multiline_calls_chain, [resharper_]align_multiline_calls_chain

Possible values:

true | false

Examples:

true
MyVar.SomeMethod() ·····.OtherMethod() ·····.ThirdMethod();
false
MyVar.SomeMethod() ····.OtherMethod() ····.ThirdMethod();

Array, object and collection initializer

Property names:

[resharper_]csharp_align_multiline_array_and_object_initializer, [resharper_]align_multiline_array_and_object_initializer

Possible values:

true | false

Examples:

true
StudentName·student·new·StudentName ······················{ ··························FirstName·"John", ··························LastName·"Smith", ··························ID·116 ······················}
false
StudentName·student·new·StudentName { ····FirstName·"John", ····LastName·"Smith", ····ID·116 }

Anonymous method body

Property names:

[resharper_]csharp_indent_anonymous_method_block, [resharper_]indent_anonymous_method_block

Possible values:

true | false

Examples:

true
FooCall(delegate ········{ ············DoSomething(); ············return·0; ········});
false
FooCall(delegate { ····DoSomething(); ····return·0; });

"for" statement header

Property names:

[resharper_]csharp_align_multiline_for_stmt, [resharper_]align_multiline_for_stmt

Possible values:

true | false

Examples:

true
for·(int·0; ·····10; ·····i++) { }
false
for·(int·0; ····10; ····i++) { }

Multiple declarations

Property names:

[resharper_]csharp_align_multiple_declaration, [resharper_]align_multiple_declaration

Possible values:

true | false

Examples:

true
class·C { ····private·int·0, ················10; }
false
class·C { ····private·int·0, ········10; }

Type parameters list

Property names:

[resharper_]csharp_align_multline_type_parameter_list, [resharper_]align_multline_type_parameter_list

Possible values:

true | false

Examples:

true
class·Class<T1, ············T2, ············T3> { }
false
class·Class<T1, ····T2, ····T3> { }

Type parameter constraints

Property names:

[resharper_]csharp_align_multline_type_parameter_constrains, [resharper_]align_multline_type_parameter_constrains

Possible values:

true | false

Examples:

true
class·C<T1T2where·T1·I1 ················where·T2·I1 { }
false
class·C<T1T2where·T1·I1 ····where·T2·I1 { }

LINQ query

Property names:

[resharper_]csharp_align_linq_query, [resharper_]align_linq_query

Possible values:

true | false

Examples:

true
var·from·in·xs ········where·!=·null ········select·x;
false
var·from·in·xs ····where·!=·null ····select·x;

Other

Special "else if" treatment

Property names:

[resharper_]csharp_special_else_if_treatment, [resharper_]special_else_if_treatment

Possible values:

true | false

Examples:

true
if·(condition) { ····foo(); } else·if·(condition) { }
false
if·(condition) { ····foo(); } else ····if·(condition) ····{ ····}

Line feed at end of file

Property names:

csharp_insert_final_newline, insert_final_newline

Possible values:

true | false

Examples:

true
class·A { }
false
class·A { }

Revert to old formatting engine

Property names:

[resharper_]csharp_old_engine, [resharper_]old_engine

Possible values:

true | false

Last modified: 11 October 2017