mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 237097: [formatter] the formatter fails to break a line in a function call with new keyword in parameters
This commit is contained in:
parent
a8817857ac
commit
901a511d5d
2 changed files with 26 additions and 1 deletions
|
@ -2229,7 +2229,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
|||
// initializer
|
||||
final IASTExpression newInitializer= node.getNewInitializer();
|
||||
if (newInitializer != null || peekNextToken() == Token.tLPAREN) {
|
||||
formatParenthesizedExpression(newInitializer);
|
||||
formatFunctionCallArguments(newInitializer);
|
||||
}
|
||||
return PROCESS_SKIP;
|
||||
}
|
||||
|
|
|
@ -721,4 +721,29 @@ public class CodeFormatterTest extends BaseUITestCase {
|
|||
assertFormatterResult();
|
||||
}
|
||||
|
||||
//void f() {
|
||||
// class Object;
|
||||
// int aVeryLongParameterThatShouldBeInOneLine1;
|
||||
// int aVeryLongParameterThatShouldBeInOneLine2;
|
||||
//
|
||||
// myNewFunctionCall1(Object(aVeryLongParameterThatShouldBeInOneLine1, aVeryLongParameterThatShouldBeInOneLine2));
|
||||
//
|
||||
// myNewFunctionCall2(new Object(aVeryLongParameterThatShouldBeInOneLine1, aVeryLongParameterThatShouldBeInOneLine2));
|
||||
//}
|
||||
|
||||
//void f() {
|
||||
// class Object;
|
||||
// int aVeryLongParameterThatShouldBeInOneLine1;
|
||||
// int aVeryLongParameterThatShouldBeInOneLine2;
|
||||
//
|
||||
// myNewFunctionCall1(Object(aVeryLongParameterThatShouldBeInOneLine1,
|
||||
// aVeryLongParameterThatShouldBeInOneLine2));
|
||||
//
|
||||
// myNewFunctionCall2(new Object(aVeryLongParameterThatShouldBeInOneLine1,
|
||||
// aVeryLongParameterThatShouldBeInOneLine2));
|
||||
//}
|
||||
public void testLineWrappingOfConstructorCall_Bug237097() throws Exception {
|
||||
assertFormatterResult();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue