mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java: formatting of type annotations inside type elements
This commit is contained in:
@@ -1441,7 +1441,10 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
|
||||
@Override
|
||||
public void visitTypeElement(PsiTypeElement type) {
|
||||
if (myType2 == JavaTokenType.ELLIPSIS || myType2 == JavaTokenType.LBRACKET || myType2 == JavaTokenType.RBRACKET) {
|
||||
if (myType1 == JavaElementType.ANNOTATION || myType2 == JavaElementType.ANNOTATION) {
|
||||
createSpaceInCode(true);
|
||||
}
|
||||
else if (myType2 == JavaTokenType.ELLIPSIS || myType2 == JavaTokenType.LBRACKET || myType2 == JavaTokenType.RBRACKET) {
|
||||
createSpaceInCode(false);
|
||||
}
|
||||
else if (type.getType() instanceof PsiDisjunctionType) {
|
||||
|
||||
@@ -545,11 +545,15 @@ public class JavaFormatterSpaceTest extends AbstractJavaFormatterTest {
|
||||
doTextTest(
|
||||
"class C<@TA(1)T> {\n" +
|
||||
" L<@TA(2)A> f = (@TA(3) A) new @TA(4) A() {\n" +
|
||||
" void m(@TA(6) int @TA(7)[] p) {\n" +
|
||||
" }\n" +
|
||||
" };\n" +
|
||||
"}",
|
||||
|
||||
"class C<@TA(1) T> {\n" +
|
||||
" L<@TA(2) A> f = (@TA(3) A) new @TA(4) A() {\n" +
|
||||
" void m(@TA(6) int @TA(7) [] p) {\n" +
|
||||
" }\n" +
|
||||
" };\n" +
|
||||
"}"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user