mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
IDEA-154336 Missing space after completed @annotation
This commit is contained in:
@@ -36,7 +36,6 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.intellij.patterns.PsiJavaPatterns.psiElement;
|
||||
import static com.intellij.psi.codeStyle.JavaCodeStyleSettings.*;
|
||||
|
||||
/**
|
||||
@@ -175,7 +174,8 @@ class JavaClassNameInsertHandler implements InsertHandler<JavaPsiClassReferenceE
|
||||
if (!(obj instanceof PsiClass) || !((PsiClass)obj).isAnnotationType()) return false;
|
||||
|
||||
PsiElement leaf = context.getFile().findElementAt(context.getStartOffset());
|
||||
return psiElement(PsiIdentifier.class).withParents(PsiJavaCodeReferenceElement.class, PsiAnnotation.class).accepts(leaf);
|
||||
PsiAnnotation anno = PsiTreeUtil.getParentOfType(leaf, PsiAnnotation.class);
|
||||
return anno != null && PsiTreeUtil.isAncestor(anno.getNameReferenceElement(), leaf, false);
|
||||
}
|
||||
|
||||
static boolean shouldHaveAnnotationParameters(PsiClass annoClass) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
@interface AbcdAnno {}
|
||||
|
||||
class Foo {
|
||||
void foo(@Abc<caret>Foo.Bar f) {}
|
||||
static class Bar{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@interface AbcdAnno {}
|
||||
|
||||
class Foo {
|
||||
void foo(@AbcdAnno<caret> Foo.Bar f) {}
|
||||
static class Bar{}
|
||||
}
|
||||
@@ -1021,6 +1021,7 @@ public class ListUtils {
|
||||
public void testOnlyAnnotationsAfterAt() throws Throwable { doTest() }
|
||||
public void testOnlyAnnotationsAfterAt2() throws Throwable { doTest('\n') }
|
||||
public void testAnnotationBeforeIdentifier() { doTest('\n') }
|
||||
public void testAnnotationBeforeQualifiedReference() { doTest('\n') }
|
||||
public void testAnnotationBeforeIdentifierFinishWithSpace() { doTest(' ') }
|
||||
|
||||
public void testOnlyExceptionsInCatch1() throws Exception { doTest('\n') }
|
||||
|
||||
Reference in New Issue
Block a user