EditorConfig properties for C#: Spaces
This page lists custom ReSharper EditorConfig properties that you can use to configure formatting preferences, specifically, how to insert or remove spaces in different C# constructs.
tip
Formatting preferences listed on this page can be also configured visually, on the Code Editing | C# | Formatting Style | Spaces page of ReSharper options Alt+R, O.
[resharper_]csharp_extra_spaces
, [resharper_]extra_spaces
remove_all
: Remove all extra spacesleave_tabs
: Leave extra tabsleave_multiple
: Leave multiple extra spacesleave_all
: Leave all extra spaces and tabs
Before formatting | After formatting, remove_all |
---|---|
|
|
Before formatting | After formatting, leave_tabs |
---|---|
|
|
Before formatting | After formatting, leave_multiple |
---|---|
|
|
Before formatting | After formatting, leave_all |
---|---|
|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_if_parentheses
, [resharper_]space_before_if_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_while_parentheses
, [resharper_]space_before_while_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_catch_parentheses
, [resharper_]space_before_catch_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_switch_parentheses
, [resharper_]space_before_switch_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_for_parentheses
, [resharper_]space_before_for_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_foreach_parentheses
, [resharper_]space_before_foreach_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_using_parentheses
, [resharper_]space_before_using_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_lock_parentheses
, [resharper_]space_before_lock_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_after_keywords_in_control_flow_statements
, [resharper_]csharp_space_before_fixed_parentheses
, [resharper_]space_before_fixed_parentheses
, [resharper_]space_after_keywords_in_control_flow_statements
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_call_name_and_opening_parenthesis
, [resharper_]csharp_space_before_method_call_parentheses
, [resharper_]space_before_method_call_parentheses
, [resharper_]space_between_method_call_name_and_opening_parenthesis
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_call_name_and_opening_parenthesis
, [resharper_]csharp_space_before_empty_method_call_parentheses
, [resharper_]space_before_empty_method_call_parentheses
, [resharper_]space_between_method_call_name_and_opening_parenthesis
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_declaration_name_and_open_parenthesis
, [resharper_]csharp_space_before_method_parentheses
, [resharper_]space_before_method_parentheses
, [resharper_]space_between_method_declaration_name_and_open_parenthesis
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_declaration_name_and_open_parenthesis
, [resharper_]csharp_space_before_empty_method_parentheses
, [resharper_]space_before_empty_method_parentheses
, [resharper_]space_between_method_declaration_name_and_open_parenthesis
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_typeof_parentheses
, [resharper_]space_before_typeof_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_default_parentheses
, [resharper_]space_before_default_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_checked_parentheses
, [resharper_]space_before_checked_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_sizeof_parentheses
, [resharper_]space_before_sizeof_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_nameof_parentheses
, [resharper_]space_before_nameof_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_new_parentheses
, [resharper_]space_before_new_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_between_keyword_and_expression
, [resharper_]space_between_keyword_and_expression
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_between_keyword_and_type
, [resharper_]space_between_keyword_and_type
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_if_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_if_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_while_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_while_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_catch_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_catch_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_switch_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_switch_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_for_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_for_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_foreach_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_foreach_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_using_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_using_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_lock_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_lock_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_fixed_parentheses
, [resharper_]csharp_space_between_parentheses_of_control_flow_statements
, [resharper_]space_within_fixed_parentheses
, [resharper_]space_between_parentheses_of_control_flow_statements
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_parentheses
, [resharper_]space_within_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_between_typecast_parentheses
, [resharper_]space_between_typecast_parentheses
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_declaration_parameter_list_parentheses
, [resharper_]space_between_method_declaration_parameter_list_parentheses
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses
, [resharper_]space_between_method_declaration_empty_parameter_list_parentheses
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_call_parameter_list_parentheses
, [resharper_]space_between_method_call_parameter_list_parentheses
true | false
true |
---|
|
false |
---|
|
csharp_space_between_method_call_empty_parameter_list_parentheses
, [resharper_]space_between_method_call_empty_parameter_list_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_typeof_parentheses
, [resharper_]space_within_typeof_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_default_parentheses
, [resharper_]space_within_default_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_checked_parentheses
, [resharper_]space_within_checked_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_sizeof_parentheses
, [resharper_]space_within_sizeof_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_nameof_parentheses
, [resharper_]space_within_nameof_parentheses
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_new_parentheses
, [resharper_]space_within_new_parentheses
true | false
true |
---|
|
false |
---|
|
csharp_space_before_open_square_brackets
, [resharper_]csharp_space_before_array_access_brackets
, [resharper_]space_before_array_access_brackets
, [resharper_]space_before_open_square_brackets
true | false
true |
---|
|
false |
---|
|
csharp_space_before_open_square_brackets
, [resharper_]csharp_space_before_array_rank_brackets
, [resharper_]space_before_array_rank_brackets
, [resharper_]space_before_open_square_brackets
true | false
true |
---|
|
false |
---|
|
csharp_space_between_square_brackets
, [resharper_]csharp_space_within_array_access_brackets
, [resharper_]space_within_array_access_brackets
, [resharper_]space_between_square_brackets
true | false
true |
---|
|
false |
---|
|
csharp_space_between_square_brackets
, [resharper_]csharp_space_within_list_pattern_brackets
, [resharper_]space_within_list_pattern_brackets
, [resharper_]space_between_square_brackets
true | false
true |
---|
|
false |
---|
|
csharp_space_between_square_brackets
, [resharper_]csharp_space_within_array_rank_brackets
, [resharper_]space_within_array_rank_brackets
, [resharper_]space_between_square_brackets
true | false
true |
---|
|
false |
---|
|
csharp_space_between_empty_square_brackets
, [resharper_]csharp_space_within_array_rank_empty_brackets
, [resharper_]space_within_array_rank_empty_brackets
, [resharper_]space_between_empty_square_brackets
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_type_parameter_angle
, [resharper_]space_before_type_parameter_angle
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_type_argument_angle
, [resharper_]space_before_type_argument_angle
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_type_parameter_angles
, [resharper_]space_within_type_parameter_angles
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_type_argument_angles
, [resharper_]space_within_type_argument_angles
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_singleline_accessorholder
, [resharper_]space_before_singleline_accessorholder
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_in_singleline_accessorholder
, [resharper_]space_in_singleline_accessorholder
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_between_accessors_in_singleline_property
, [resharper_]space_between_accessors_in_singleline_property
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_empty_braces
, [resharper_]space_within_empty_braces
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_in_singleline_method
, [resharper_]space_in_singleline_method
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_in_singleline_anonymous_method
, [resharper_]space_in_singleline_anonymous_method
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_single_line_array_initializer_braces
, [resharper_]space_within_single_line_array_initializer_braces
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_assignment_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_assignment_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_logical_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_logical_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_equality_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_equality_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_relational_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_relational_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_bitwise_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_bitwise_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_additive_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_additive_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_multiplicative_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_multiplicative_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_shift_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_shift_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_nullcoalescing_op
, [resharper_]csharp_space_around_binary_operator
, [resharper_]space_around_nullcoalescing_op
, [resharper_]space_around_binary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_arrow_op
, [resharper_]csharp_space_around_member_access_operator
, [resharper_]space_around_arrow_op
, [resharper_]space_around_member_access_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_logical_not_op
, [resharper_]csharp_space_after_unary_operator
, [resharper_]space_after_logical_not_op
, [resharper_]space_after_unary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_unary_minus_op
, [resharper_]csharp_space_after_unary_operator
, [resharper_]space_after_unary_minus_op
, [resharper_]space_after_unary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_unary_plus_op
, [resharper_]csharp_space_after_unary_operator
, [resharper_]space_after_unary_plus_op
, [resharper_]space_after_unary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_ampersand_op
, [resharper_]csharp_space_after_unary_operator
, [resharper_]space_after_ampersand_op
, [resharper_]space_after_unary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_asterik_op
, [resharper_]csharp_space_after_unary_operator
, [resharper_]space_after_asterik_op
, [resharper_]space_after_unary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_near_postfix_and_prefix_op
, [resharper_]space_near_postfix_and_prefix_op
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_ternary_quest
, [resharper_]csharp_space_around_ternary_operator
, [resharper_]space_before_ternary_quest
, [resharper_]space_around_ternary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_ternary_quest
, [resharper_]csharp_space_around_ternary_operator
, [resharper_]space_after_ternary_quest
, [resharper_]space_around_ternary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_ternary_colon
, [resharper_]csharp_space_around_ternary_operator
, [resharper_]space_before_ternary_colon
, [resharper_]space_around_ternary_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_ternary_colon
, [resharper_]csharp_space_around_ternary_operator
, [resharper_]space_after_ternary_colon
, [resharper_]space_around_ternary_operator
true | false
true |
---|
|
false |
---|
|
csharp_space_before_comma
, [resharper_]space_before_comma
true | false
true |
---|
|
false |
---|
|
csharp_space_after_comma
, [resharper_]space_after_comma
true | false
true |
---|
|
false |
---|
|
csharp_space_before_semicolon_in_for_statement
, [resharper_]space_before_semicolon_in_for_statement
true | false
true |
---|
|
false |
---|
|
csharp_space_after_semicolon_in_for_statement
, [resharper_]space_after_semicolon_in_for_statement
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_semicolon
, [resharper_]space_before_semicolon
true | false
true |
---|
|
false |
---|
|
csharp_space_before_colon_in_inheritance_clause
, [resharper_]space_before_colon_in_inheritance_clause
true | false
true |
---|
|
false |
---|
|
csharp_space_after_colon_in_inheritance_clause
, [resharper_]space_after_colon_in_inheritance_clause
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_type_parameter_constraint_colon
, [resharper_]space_before_type_parameter_constraint_colon
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_type_parameter_constraint_colon
, [resharper_]space_after_type_parameter_constraint_colon
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_colon_in_case
, [resharper_]space_before_colon_in_case
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_colon_in_case
, [resharper_]space_after_colon_in_case
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_attribute_colon
, [resharper_]csharp_space_before_colon
, [resharper_]space_before_attribute_colon
, [resharper_]space_before_colon
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_attribute_colon
, [resharper_]csharp_space_after_colon
, [resharper_]space_after_attribute_colon
, [resharper_]space_after_colon
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_between_attribute_sections
, [resharper_]space_between_attribute_sections
true | false
true |
---|
|
false |
---|
|
csharp_space_between_square_brackets
, [resharper_]csharp_space_within_attribute_brackets
, [resharper_]space_within_attribute_brackets
, [resharper_]space_between_square_brackets
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_attributes
, [resharper_]space_after_attributes
true | false
true |
---|
|
false |
---|
|
csharp_space_after_cast
, [resharper_]space_after_cast
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_dot
, [resharper_]csharp_space_around_member_access_operator
, [resharper_]space_around_dot
, [resharper_]space_around_member_access_operator
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_lambda_arrow
, [resharper_]space_around_lambda_arrow
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_pointer_asterik_declaration
, [resharper_]space_before_pointer_asterik_declaration
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_nullable_mark
, [resharper_]space_before_nullable_mark
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_around_alias_eq
, [resharper_]space_around_alias_eq
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_before_trailing_comment
, [resharper_]space_before_trailing_comment
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_after_operator_keyword
, [resharper_]space_after_operator_keyword
true | false
true |
---|
|
false |
---|
|
[resharper_]csharp_space_within_slice_pattern
, [resharper_]space_within_slice_pattern
true | false
true |
---|
|
false |
---|
|