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

Bug 359905 - Invalid formatting of comment in enum.

This commit is contained in:
Sergey Prigogin 2011-10-04 15:58:24 -07:00
parent 352a7b7c51
commit 371bca30f3
2 changed files with 13 additions and 3 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

@ -2737,16 +2737,25 @@ public class CodeFormatterTest extends BaseUITestCase {
}
//enum SomeEnum {
//FirstValue, // first value comment
//SecondValue // second value comment
//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
//};
public void _testEnum() throws Exception {
//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();
}
}