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:
parent
352a7b7c51
commit
371bca30f3
2 changed files with 13 additions and 3 deletions
|
@ -2032,6 +2032,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
|||
scribe.space();
|
||||
}
|
||||
}
|
||||
scribe.printTrailingComment();
|
||||
|
||||
if (enumIndent > braceIndent) {
|
||||
scribe.unIndent();
|
||||
|
|
|
@ -2740,13 +2740,22 @@ public class CodeFormatterTest extends BaseUITestCase {
|
|||
//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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue