mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-05 14:43:36 +02:00
Bug 359905 - Invalid formatting of comment in enum.
This commit is contained in:
parent
242b783c8c
commit
3edce39739
2 changed files with 23 additions and 0 deletions
|
@ -2032,6 +2032,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
||||||
scribe.space();
|
scribe.space();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
scribe.printTrailingComment();
|
||||||
|
|
||||||
if (enumIndent > braceIndent) {
|
if (enumIndent > braceIndent) {
|
||||||
scribe.unIndent();
|
scribe.unIndent();
|
||||||
|
|
|
@ -2736,4 +2736,26 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
assertFormatterResult();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue