1
0
Fork 0
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:
Anton Leherbauer 2008-06-20 09:04:55 +00:00
parent a8817857ac
commit 901a511d5d
2 changed files with 26 additions and 1 deletions

View file

@ -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;
}

View file

@ -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();
}
}