[java formatter] space between enum constant and annotation

This commit is contained in:
Yaroslav Lepenkin
2017-03-28 10:57:00 +03:00
parent d43b5c13b3
commit 7561efbf46
2 changed files with 16 additions and 0 deletions
@@ -1720,6 +1720,9 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
else if (myRole2 == ChildRole.ANONYMOUS_CLASS) {
myResult = getSpaceBeforeLBrace(myChild2, mySettings.SPACE_BEFORE_CLASS_LBRACE, null);
}
else if (myRole1 == ChildRole.MODIFIER_LIST && myRole2 == ChildRole.NAME) {
createSpaceInCode(true);
}
}
@Override
@@ -660,5 +660,18 @@ public class JavaFormatterSpaceTest extends AbstractJavaFormatterTest {
"public static void bar(@NonNls final String[] args) {\n" +
"}");
}
public void testEnumAnnotations() {
doTextTest("enum SampleEnum {\n" +
" @Annotation(\"1\")ONE,\n" +
" @Annotation(\"2\")TWO,\n" +
" @Annotation THREE\n" +
"}",
"enum SampleEnum {\n" +
" @Annotation(\"1\") ONE,\n" +
" @Annotation(\"2\") TWO,\n" +
" @Annotation THREE\n" +
"}");
}
}