java completion: enable package suggestions inside type arguments (IDEA-193049)

This commit is contained in:
peter
2018-06-04 15:45:38 +02:00
parent cee969d9ea
commit 1da11d0a35
4 changed files with 9 additions and 5 deletions
@@ -116,7 +116,8 @@ public class JavaCompletionContributor extends CompletionContributor {
if (JavaKeywordCompletion.isDeclarationStart(position) ||
JavaKeywordCompletion.isInsideParameterList(position) ||
isInsideAnnotationName(position)) {
isInsideAnnotationName(position) ||
psiElement().inside(PsiReferenceParameterList.class).accepts(position)) {
return new OrFilter(ElementClassFilter.CLASS, ElementClassFilter.PACKAGE);
}
@@ -143,10 +144,6 @@ public class JavaCompletionContributor extends CompletionContributor {
return ElementClassFilter.CLASS;
}
if (psiElement().inside(PsiReferenceParameterList.class).accepts(position)) {
return ElementClassFilter.CLASS;
}
if (psiElement().inside(PsiAnnotationParameterList.class).accepts(position)) {
return createAnnotationFilter(position);
}
@@ -0,0 +1,3 @@
class Foo {
List<java.la<caret>> foo() {}
}
@@ -0,0 +1,3 @@
class Foo {
List<java.lang.<caret>> foo() {}
}
@@ -1351,6 +1351,7 @@ class XInternalError {}
void testNoClosingWhenChoosingWithParenBeforeIdentifier() { doTest '(' }
void testPackageInMemberType() { doTest() }
void testPackageInMemberTypeGeneric() { doTest() }
void testConstantInAnno() { doTest('\n') }