ReSharper 2017.1 Help

C++ - Indentation and Alignment

Indentation

Continuous line indent

Property names:

[resharper_]cpp_continuous_line_indent, [resharper_]continuous_line_indent

Possible values:

  • double
  • single
  • none

Examples:

double
int·foo1()·+ ····foo2();
single
int·foo1()·+ ··foo2();
none
int·foo1()·+ foo2();

Indent namespace members

Property names:

[resharper_]cpp_namespace_indentation, [resharper_]namespace_indentation

Possible values:

  • all: Indent all
  • inner: Indent only in inner namespaces
  • none: Do not indent

Examples:

all
namespace·ns { ··void·a(); ··namespace·inner ··{ ····void·b(); ··}; };
inner
namespace·ns { void·a(); namespace·inner { ··void·b(); }; };
none
namespace·ns { void·a(); namespace·inner { void·b(); }; };

Indent access specifier from class

Property names:

[resharper_]cpp_indent_access_specifiers_from_class, [resharper_]indent_access_specifiers_from_class

Possible values:

true | false

Examples:

true
class·C { ··public: ··void·a(); };
false
class·C { public: ··void·a(); };

Indent "case" from "switch"

Property names:

[resharper_]cpp_indent_switch_labels, [resharper_]indent_switch_labels

Possible values:

true | false

Examples:

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

Preprocessor directives indenting

Property names:

[resharper_]cpp_indent_preprocessor_directives, [resharper_]indent_preprocessor_directives

Possible values:

  • do_not_change: Do not change
  • normal: Indent
  • none: No indent

Examples:

do_not_change
void·sections() { #pragma·omp·sections ··{ ····int·x; ··} }
normal
void·sections() { ··#pragma·omp·sections ··{ ····int·x; ··} }
none
void·sections() { #pragma·omp·sections ··{ ····int·x; ··} }

Align multiline construct

Declarators in declaration

Property names:

[resharper_]cpp_align_multiple_declaration, [resharper_]align_multiple_declaration

Possible values:

true | false

Examples:

true
int·first, ····second
false
int·first, ··second

Function parameters

Property names:

[resharper_]cpp_align_multiline_parameter, [resharper_]align_multiline_parameter

Possible values:

true | false

Examples:

true
double·average(double·first, ···············double·second);
false
double·average(double·first, ··double·second);

Call arguments

Property names:

[resharper_]cpp_align_multiline_argument, [resharper_]align_multiline_argument

Possible values:

true | false

Examples:

true
object.method(first, ··············second);
false
object.method(first, ··second);

First call argument by '('

Property names:

[resharper_]cpp_align_first_arg_by_paren, [resharper_]align_first_arg_by_paren

Possible values:

true | false

Examples:

true
object.method( ··············first, ··············second);
false
object.method( ··first, ··second);

Template parameters in template declaration

Property names:

[resharper_]cpp_align_multiline_type_parameter, [resharper_]align_multiline_type_parameter

Possible values:

true | false

Examples:

true
template·<typename·K, ··········typename·V> struct·map;
false
template·<typename·K, ··typename·V> struct·map;

Template arguments

Property names:

[resharper_]cpp_align_multiline_type_argument, [resharper_]align_multiline_type_argument

Possible values:

true | false

Examples:

true
std::map<char·*, ·········MyStructmy_map;
false
std::map<char·*, ··MyStructmy_map;

Base classes in class base clause

Property names:

[resharper_]cpp_align_multiline_extends_list, [resharper_]align_multiline_extends_list

Possible values:

true | false

Examples:

true
struct·MyStruct·Base1, ··················Base2 { };
false
struct·MyStruct·Base1, ··Base2 { };

Member initializers in member initializer lists

Property names:

[resharper_]cpp_align_multiline_ctor_init, [resharper_]align_multiline_ctor_init

Possible values:

true | false

Examples:

true
struct·MyStruct { ··MyStruct()·first(f), ···············second(s) ··{ ··} };
false
struct·MyStruct { ··MyStruct()·first(f), ····second(s) ··{ ··} };

Line break before comma in member initializer lists

Property names:

[resharper_]cpp_line_break_before_comma_in_member_initializer_lists, [resharper_]line_break_before_comma_in_member_initializer_lists

Possible values:

true | false

Examples:

true
struct·MyStruct { ··MyStruct()·first(f) ·············second(s) ··{ ··} };
false
struct·MyStruct { ··MyStruct()·first(f),·second(s) ··{ ··} };

Line break after comma in member initializer lists

Property names:

[resharper_]cpp_line_break_after_comma_in_member_initializer_lists, [resharper_]line_break_after_comma_in_member_initializer_lists

Possible values:

true | false

Examples:

true
struct·MyStruct { ··MyStruct()·first(f), ···············second(s) ··{ ··} };
false
struct·MyStruct { ··MyStruct()·first(f),·second(s) ··{ ··} };

?: operator

Property names:

[resharper_]cpp_align_ternary, [resharper_]align_ternary

Possible values:

  • none: No align
  • align_not_nested: Align except when nested
  • align_all: Align

Examples:

none
int·var·56·(cond1 ··result1 ··cond2 ··result2 ··result3);
align_not_nested
int·var·56·(cond1 ··················result1 ··················cond2 ··················result2 ··················result3);
align_all
int·var·56·(cond1 ··················result1 ··················cond2 ······················result2 ······················result3);

Chained method calls

Property names:

[resharper_]cpp_align_multiline_calls_chain, [resharper_]align_multiline_calls_chain

Possible values:

true | false

Examples:

true
struct·X { ··foo(x) ··{ ····x.foo() ·····.foo() ·····.foo(); ··} };
false
struct·X { ··foo(x) ··{ ····x.foo() ······.foo() ······.foo(); ··} };

Chained binary expressions

Property names:

[resharper_]cpp_align_multiline_binary_expressions_chain, [resharper_]align_multiline_binary_expressions_chain

Possible values:

true | false

Examples:

true
int·var·1 ··········2 ··········3;
false
int·var·1 ··2 ··3;
Last modified: 4 July 2017