mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 357300 - Function parameter line wrapping wraps commas separating parameters
This commit is contained in:
parent
c71e247578
commit
cd17d74157
2 changed files with 14 additions and 8 deletions
|
@ -2089,14 +2089,6 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < elementsLength; i++) {
|
for (i = 0; i < elementsLength; i++) {
|
||||||
final IASTNode node= elements.get(i);
|
final IASTNode node= elements.get(i);
|
||||||
if (i < elementsLength - 1) {
|
|
||||||
scribe.setTailFormatter(
|
|
||||||
new TrailingTokenFormatter(options.fSeparatorToken,
|
|
||||||
options.fSpaceBeforeSeparator,
|
|
||||||
options.fSpaceAfterSeparator));
|
|
||||||
} else {
|
|
||||||
scribe.setTailFormatter(tailFormatter);
|
|
||||||
}
|
|
||||||
scribe.alignFragment(alignment, i);
|
scribe.alignFragment(alignment, i);
|
||||||
if (node instanceof ICPPASTConstructorChainInitializer) {
|
if (node instanceof ICPPASTConstructorChainInitializer) {
|
||||||
// Constructor chain initializer is a special case.
|
// Constructor chain initializer is a special case.
|
||||||
|
@ -2105,7 +2097,13 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
||||||
node.accept(this);
|
node.accept(this);
|
||||||
}
|
}
|
||||||
if (i < elementsLength - 1) {
|
if (i < elementsLength - 1) {
|
||||||
|
scribe.setTailFormatter(
|
||||||
|
new TrailingTokenFormatter(options.fSeparatorToken,
|
||||||
|
options.fSpaceBeforeSeparator,
|
||||||
|
options.fSpaceAfterSeparator));
|
||||||
scribe.runTailFormatter();
|
scribe.runTailFormatter();
|
||||||
|
} else {
|
||||||
|
scribe.setTailFormatter(tailFormatter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (addEllipsis) {
|
if (addEllipsis) {
|
||||||
|
|
|
@ -2688,4 +2688,12 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
assertFormatterResult();
|
assertFormatterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//void wrap_when_necessary(more_than_one_template_argument_t<int, float> p1, no_template_arguments_t p2, no_template_arguments_t p3) {}
|
||||||
|
|
||||||
|
//void wrap_when_necessary(more_than_one_template_argument_t<int, float> p1,
|
||||||
|
// no_template_arguments_t p2, no_template_arguments_t p3) {
|
||||||
|
//}
|
||||||
|
public void testTemplateIdInParameterList_Bug357300() throws Exception {
|
||||||
|
assertFormatterResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue