File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ struct Config
4444 // /
4545 OptionalBoolean dfmt_space_after_keywords;
4646 // /
47+ OptionalBoolean dfmt_space_before_function_parameters;
48+ // /
4749 OptionalBoolean dfmt_split_operator_at_line_end;
4850 // /
4951 OptionalBoolean dfmt_selective_import_space;
@@ -72,6 +74,7 @@ struct Config
7274 dfmt_soft_max_line_length = 80 ;
7375 dfmt_space_after_cast = OptionalBoolean.t;
7476 dfmt_space_after_keywords = OptionalBoolean.t;
77+ dfmt_space_before_function_parameters = OptionalBoolean.f;
7578 dfmt_split_operator_at_line_end = OptionalBoolean.f;
7679 dfmt_selective_import_space = OptionalBoolean.t;
7780 dfmt_compact_labeled_statements = OptionalBoolean.t;
Original file line number Diff line number Diff line change @@ -281,6 +281,8 @@ private:
281281 {
282282 writeToken();
283283 if (index < tokens.length && (currentIs(tok! " identifier" )
284+ || ( ( isBasicType(peekBack().type) || peekBackIs(tok! " identifier" ) ) &&
285+ currentIs(tok! (" (" )) && config.dfmt_space_before_function_parameters)
284286 || isBasicType(current.type) || currentIs(tok! " @" ) || currentIs(tok! " if" )
285287 || isNumberLiteral(tokens[index].type) || (inAsm
286288 && peekBack2Is(tok! " ;" ) && currentIs(tok! " [" ))))
Original file line number Diff line number Diff line change 4848 case " space_after_cast" :
4949 optConfig.dfmt_space_after_cast = optVal;
5050 break ;
51+ case " space_before_function_parameters" :
52+ optConfig.dfmt_space_before_function_parameters = optVal;
53+ break ;
5154 case " split_operator_at_line_end" :
5255 optConfig.dfmt_split_operator_at_line_end = optVal;
5356 break ;
8083 " outdent_attributes" , &handleBooleans,
8184 " space_after_cast" , &handleBooleans,
8285 " selective_import_space" , &handleBooleans,
86+ " space_before_function_parameters" , &handleBooleans,
8387 " split_operator_at_line_end" , &handleBooleans,
8488 " compact_labeled_statements" , &handleBooleans,
8589 " tab_width" , &optConfig.tab_width,
@@ -271,6 +275,7 @@ Formatting Options:
271275 --max_line_length
272276 --outdent_attributes
273277 --space_after_cast
278+ --space_before_function_parameters
274279 --selective_import_space
275280 --split_operator_at_line_end
276281 --compact_labeled_statements
You can’t perform that action at this time.
0 commit comments