IDEA-90142 Do not propose contant names after '@'

This commit is contained in:
peter
2012-08-14 14:59:50 +02:00
parent 8d784f01c4
commit 546028e1aa
4 changed files with 27 additions and 1 deletions

View File

@@ -113,7 +113,8 @@ public class JavaCompletionContributor extends CompletionContributor {
}
if (JavaCompletionData.DECLARATION_START.accepts(position) ||
JavaCompletionData.isInsideParameterList(position)) {
JavaCompletionData.isInsideParameterList(position) ||
psiElement().inside(psiElement(PsiJavaCodeReferenceElement.class).withParent(psiAnnotation())).accepts(position)) {
return new OrFilter(ElementClassFilter.CLASS, ElementClassFilter.PACKAGE_FILTER);
}

View File

@@ -0,0 +1,12 @@
import static BeanUtil.A.NOT_NULL;
class BeanUtil {
public static class A {
public static final Object NOT_NULL = null;
}
@NN<caret>
String foo() {
return null;
}
}
@interface NotNull {}

View File

@@ -0,0 +1,12 @@
import static BeanUtil.A.NOT_NULL;
class BeanUtil {
public static class A {
public static final Object NOT_NULL = null;
}
@NotNull<caret>
String foo() {
return null;
}
}
@interface NotNull {}

View File

@@ -991,6 +991,7 @@ public class ListUtils {
public void testLiveTemplatePrefixTab() throws Throwable {doTest('\t') }
public void testOnlyAnnotationsAfterAt() throws Throwable { doTest() }
public void testOnlyAnnotationsAfterAt2() throws Throwable { doTest() }
public void testOnlyExceptionsInCatch1() throws Exception { doTest('\n') }
public void testOnlyExceptionsInCatch2() throws Exception { doTest('\n') }