1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 359905 - Invalid formatting of comment in enum.

This commit is contained in:
Sergey Prigogin 2011-10-04 16:30:12 -07:00
parent 242b783c8c
commit 3edce39739
2 changed files with 23 additions and 0 deletions

View file

@ -2032,6 +2032,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
scribe.space();
}
}
scribe.printTrailingComment();
if (enumIndent > braceIndent) {
scribe.unIndent();

View file

@ -2736,4 +2736,26 @@ public class CodeFormatterTest extends BaseUITestCase {
assertFormatterResult();
}
//enum SomeEnum {
//FirstValue,// first value comment
//SecondValue// second value comment
//};
//enum OtherEnum {
//First,// first value comment
//Second,// second value comment
//};
//enum SomeEnum {
// FirstValue, // first value comment
// SecondValue // second value comment
//};
//enum OtherEnum {
// First, // first value comment
// Second, // second value comment
//};
public void testEnum() throws Exception {
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, "2");
assertFormatterResult();
}
}