C++ - Indentation and Alignment
Last modified: 21 July 2022Indentation
Continuous line indent
Property names:
[resharper_]cpp_continuous_line_indent
, [resharper_]continuous_line_indent
Possible values:
none
single
double
Examples:
none |
---|
|
single |
---|
|
double |
---|
|
Use continuous line indent in function declaration and invocation parentheses
Property names:
[resharper_]cpp_use_continuous_line_indent_in_method_pars
, [resharper_]use_continuous_line_indent_in_method_pars
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Use continuous line indent in initializer lists
Property names:
[resharper_]cpp_use_continuous_line_indent_in_expression_braces
, [resharper_]use_continuous_line_indent_in_expression_braces
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Indent namespace members
Property names:
[resharper_]cpp_namespace_indentation
, [resharper_]namespace_indentation
Possible values:
none
: Do not indentinner
: Indent only in inner namespacesall
: Indent all
Examples:
none |
---|
|
inner |
---|
|
all |
---|
|
Indent linkage specification block members
Property names:
[resharper_]cpp_linkage_specification_indentation
, [resharper_]linkage_specification_indentation
Possible values:
none
: Do not indentinner
: Indent only in inner namespacesall
: Indent all
Examples:
none |
---|
|
inner |
---|
|
all |
---|
|
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 |
---|
|
false |
---|
|
Indent class member from access specifier
Property names:
[resharper_]cpp_indent_class_members_from_access_specifiers
, [resharper_]indent_class_members_from_access_specifiers
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Indent if a function definition or declaration is wrapped after the type
Property names:
[resharper_]cpp_indent_wrapped_function_names
, [resharper_]indent_wrapped_function_names
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Indent "case" from "switch"
Property names:
[resharper_]cpp_indent_switch_labels
, [resharper_]indent_switch_labels
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Indent function declarations' parentheses
Property names:
[resharper_]cpp_indent_method_decl_pars
, [resharper_]indent_method_decl_pars
Possible values:
inside
: Inside parenthesis (BSD/K&R style)outside
: Parenthesis and inside equally (Whitesmiths style)outside_and_inside
: Parenthesis 1x, inside 2x (GNU style)none
: No indent
Examples:
inside |
---|
|
outside |
---|
|
outside_and_inside |
---|
|
none |
---|
|
Indent method calls' parentheses
Property names:
[resharper_]cpp_indent_invocation_pars
, [resharper_]indent_invocation_pars
Possible values:
inside
: Inside parenthesis (BSD/K&R style)outside
: Parenthesis and inside equally (Whitesmiths style)outside_and_inside
: Parenthesis 1x, inside 2x (GNU style)none
: No indent
Examples:
inside |
---|
|
outside |
---|
|
outside_and_inside |
---|
|
none |
---|
|
Indent statement (if, while, for, etc) parentheses
Property names:
[resharper_]cpp_indent_statement_pars
, [resharper_]indent_statement_pars
Possible values:
inside
: Inside parenthesis (BSD/K&R style)outside
: Parenthesis and inside equally (Whitesmiths style)outside_and_inside
: Parenthesis 1x, inside 2x (GNU style)none
: No indent
Examples:
inside |
---|
|
outside |
---|
|
outside_and_inside |
---|
|
none |
---|
|
Preprocessor directives indenting
Property names:
[resharper_]cpp_indent_preprocessor_directives
, [resharper_]indent_preprocessor_directives
Possible values:
none
: No indentnormal
: Indentdo_not_change
: Do not change
Examples:
none |
---|
|
normal |
---|
|
do_not_change |
---|
|
Indent C++/CLI generic constraints
Property names:
[resharper_]cpp_indent_type_constraints
, [resharper_]indent_type_constraints
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Indent comments started at the first column
Property names:
[resharper_]cpp_indent_comment
, [resharper_]indent_comment
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place comments at the first column when commenting out code
Property names:
[resharper_]cpp_place_comments_at_first_column
, [resharper_]place_comments_at_first_column
Place comments at the first column when commenting out code. Otherwise, comments will use the indentation level of the commented code.
Possible values:
true | false
Align multiline construct
Declarators in declaration
Property names:
[resharper_]cpp_align_multiple_declaration
, [resharper_]align_multiple_declaration
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Function parameters
Property names:
[resharper_]cpp_align_multiline_parameter
, [resharper_]align_multiline_parameter
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Call arguments
Property names:
[resharper_]cpp_align_multiline_argument
, [resharper_]align_multiline_argument
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
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 |
---|
|
false |
---|
|
Initializer list arguments
Property names:
[resharper_]cpp_align_multiline_expression_braces
, [resharper_]align_multiline_expression_braces
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Template parameters in template declaration
Property names:
[resharper_]cpp_align_multiline_type_parameter
, [resharper_]align_multiline_type_parameter
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Template arguments
Property names:
[resharper_]cpp_align_multiline_type_argument
, [resharper_]align_multiline_type_argument
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
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 |
---|
|
false |
---|
|
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 |
---|
|
false |
---|
|
Outdent commas
Property names:
[resharper_]cpp_outdent_commas
, [resharper_]outdent_commas
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
?: operator
Property names:
[resharper_]cpp_align_ternary
, [resharper_]align_ternary
Possible values:
align_all
: Alignalign_not_nested
: Align except when nestednone
: No align
Examples:
align_all |
---|
|
align_not_nested |
---|
|
none |
---|
|
Indent aligned ?: operator
Property names:
[resharper_]cpp_indent_aligned_ternary
, [resharper_]indent_aligned_ternary
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Chained method calls
Property names:
[resharper_]cpp_align_multiline_calls_chain
, [resharper_]align_multiline_calls_chain
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Outdent "." and "->" in chained method calls
Property names:
[resharper_]cpp_outdent_dots
, [resharper_]outdent_dots
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Chained binary expressions
Property names:
[resharper_]cpp_align_multiline_binary_expressions_chain
, [resharper_]align_multiline_binary_expressions_chain
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Align similar code in columns
Fix column alignment in adjacent lines
Property names:
[resharper_]cpp_int_align_fix_in_adjacent
, [resharper_]int_align_fix_in_adjacent
When formatting some code, also fix column alignment in adjacent lines if needed
Possible values:
true | false
Assignments
Property names:
[resharper_]cpp_int_align_eq
, [resharper_]int_align_eq
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Declaration names
Property names:
[resharper_]cpp_int_align_declaration_names
, [resharper_]int_align_declaration_names
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
End comments
Property names:
[resharper_]cpp_int_align_comments
, [resharper_]int_align_comments
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|