mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-10 18:45:26 +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.space();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
scribe.printTrailingComment();
|
||||||
|
|
||||||
if (enumIndent > braceIndent) {
|
if (enumIndent > braceIndent) {
|
||||||
scribe.unIndent();
|
scribe.unIndent();
|
||||||
|
|
|
@ -2737,16 +2737,25 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
//enum SomeEnum {
|
//enum SomeEnum {
|
||||||
//FirstValue, // first value comment
|
//FirstValue,// first value comment
|
||||||
//SecondValue // second value comment
|
//SecondValue// second value comment
|
||||||
|
//};
|
||||||
|
//enum OtherEnum {
|
||||||
|
//First,// first value comment
|
||||||
|
//Second,// second value comment
|
||||||
//};
|
//};
|
||||||
|
|
||||||
//enum SomeEnum {
|
//enum SomeEnum {
|
||||||
// FirstValue, // first value comment
|
// FirstValue, // first value comment
|
||||||
// SecondValue // second 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_TAB_CHAR, CCorePlugin.SPACE);
|
||||||
|
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, "2");
|
||||||
assertFormatterResult();
|
assertFormatterResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue