C++ - Line breaks and Wrapping
Last modified: 21 July 2022General
Line feed at end of file
Property names:
insert_final_newline
, [resharper_]cpp_insert_final_newline
Possible values:
true | false
Place on new line
Place "else" on new line after compound statement
Property names:
[resharper_]cpp_new_line_before_else
, [resharper_]new_line_before_else
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place "while" on new line after compound statement
Property names:
[resharper_]cpp_new_line_before_while
, [resharper_]new_line_before_while
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place "catch" on new line after compound statement
Property names:
[resharper_]cpp_new_line_before_catch
, [resharper_]new_line_before_catch
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Break line in single embedded statement
Property names:
[resharper_]cpp_simple_embedded_statement_style
, [resharper_]simple_embedded_statement_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line in simple "case" statement
Property names:
[resharper_]cpp_simple_case_statement_style
, [resharper_]simple_case_statement_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line after member function definition return type
Property names:
[resharper_]cpp_function_definition_return_type_style
, [resharper_]function_definition_return_type_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line after top-level function definition return type
Property names:
[resharper_]cpp_toplevel_function_definition_return_type_style
, [resharper_]toplevel_function_definition_return_type_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line after member function declaration return type
Property names:
[resharper_]cpp_function_declaration_return_type_style
, [resharper_]function_declaration_return_type_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line after top-level function declaration return type
Property names:
[resharper_]cpp_toplevel_function_declaration_return_type_style
, [resharper_]toplevel_function_declaration_return_type_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line after the template<...> of a template declaration
Property names:
[resharper_]cpp_break_template_declaration
, [resharper_]break_template_declaration
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line before the requires-clause
Property names:
[resharper_]cpp_line_break_before_requires_clause
, [resharper_]line_break_before_requires_clause
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line before colon in member initializer lists
Property names:
[resharper_]cpp_member_initializer_list_style
, [resharper_]member_initializer_list_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line after colon in member initializer lists
Property names:
[resharper_]cpp_line_break_after_colon_in_member_initializer_lists
, [resharper_]line_break_after_colon_in_member_initializer_lists
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Break line 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 |
---|
|
false |
---|
|
Break line 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 |
---|
|
false |
---|
|
Allow C++/CLI generic constraints on the same line
Property names:
[resharper_]cpp_place_type_constraints_on_same_line
, [resharper_]place_type_constraints_on_same_line
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Line wrapping
Keep existing line breaks
Property names:
[resharper_]cpp_keep_user_linebreaks
, [resharper_]keep_user_linebreaks
Possible values:
true | false
Examples:
Before formatting | After formatting, true |
---|---|
|
|
Before formatting | After formatting, false |
---|---|
|
|
Hard wrap at
Property names:
max_line_length
, [resharper_]cpp_max_line_length
Possible values:
an integer
Prefer wrap before ","
Property names:
[resharper_]cpp_wrap_before_comma
, [resharper_]wrap_before_comma
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap before "," in base clause
Property names:
[resharper_]cpp_wrap_before_comma_in_base_clause
, [resharper_]wrap_before_comma_in_base_clause
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Wrap ternary expression
Property names:
[resharper_]cpp_wrap_ternary_expr_style
, [resharper_]wrap_ternary_expr_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Prefer wrap before "?" and ":" in ternary expressions
Property names:
[resharper_]cpp_wrap_before_ternary_opsigns
, [resharper_]wrap_before_ternary_opsigns
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap before ":"
Property names:
[resharper_]cpp_wrap_before_colon
, [resharper_]wrap_before_colon
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap before first C++/CLI generic constraint
Property names:
[resharper_]cpp_wrap_before_first_type_parameter_constraint
, [resharper_]wrap_before_first_type_parameter_constraint
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Wrap multiple C++/CLI generic constraints
Property names:
[resharper_]cpp_wrap_multiple_type_parameter_constraints_style
, [resharper_]wrap_multiple_type_parameter_constraints_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Wrap enum definition
Property names:
[resharper_]cpp_wrap_enumeration_style
, [resharper_]wrap_enumeration_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Wrap braced initializer list
Property names:
[resharper_]cpp_wrap_braced_init_list_style
, [resharper_]wrap_braced_init_list_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Wrap base classes list
Property names:
[resharper_]cpp_wrap_base_clause_style
, [resharper_]wrap_base_clause_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Wrap constructor initializer
Property names:
[resharper_]cpp_wrap_ctor_initializer_style
, [resharper_]wrap_ctor_initializer_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Wrap formal parameters
Property names:
[resharper_]cpp_wrap_parameters_style
, [resharper_]wrap_parameters_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Prefer wrap before "(" in declaration
Property names:
[resharper_]cpp_wrap_before_declaration_lpar
, [resharper_]wrap_before_declaration_lpar
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap after "(" in declaration
Property names:
[resharper_]cpp_wrap_after_declaration_lpar
, [resharper_]wrap_after_declaration_lpar
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap before ")" in declaration
Property names:
[resharper_]cpp_wrap_before_declaration_rpar
, [resharper_]wrap_before_declaration_rpar
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Wrap invocation arguments
Property names:
[resharper_]cpp_wrap_arguments_style
, [resharper_]wrap_arguments_style
Possible values:
wrap_if_long
: Simple wrapchop_if_long
: Chop if long or multilinechop_always
: Chop always
Examples:
wrap_if_long |
---|
|
chop_if_long |
---|
|
chop_always |
---|
|
Prefer wrap before "(" in invocation
Property names:
[resharper_]cpp_wrap_before_invocation_lpar
, [resharper_]wrap_before_invocation_lpar
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap after "(" in invocation
Property names:
[resharper_]cpp_wrap_after_invocation_lpar
, [resharper_]wrap_after_invocation_lpar
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap before ")" in invocation
Property names:
[resharper_]cpp_wrap_before_invocation_rpar
, [resharper_]wrap_before_invocation_rpar
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap after "{" in initializer lists
Property names:
[resharper_]cpp_wrap_after_expression_lbrace
, [resharper_]wrap_after_expression_lbrace
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Prefer wrap before "}" in initializer lists
Property names:
[resharper_]cpp_wrap_before_expression_rbrace
, [resharper_]wrap_before_expression_rbrace
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|