mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-89841 Auto-Complete Does Not Include Static Imports
This commit is contained in:
-3
@@ -301,9 +301,6 @@ public class JavaCompletionProcessor extends BaseScopeProcessor implements Eleme
|
||||
if (hintKey == JavaCompletionHints.NAME_FILTER) {
|
||||
return (T)myMatcher;
|
||||
}
|
||||
if (hintKey == JavaCompletionHints.JAVA_COMPLETION) {
|
||||
return (T)Boolean.TRUE;
|
||||
}
|
||||
|
||||
return super.getHint(hintKey);
|
||||
}
|
||||
|
||||
-1
@@ -22,7 +22,6 @@ import com.intellij.openapi.util.Key;
|
||||
* @author yole
|
||||
*/
|
||||
public class JavaCompletionHints {
|
||||
public static final Key<Boolean> JAVA_COMPLETION = Key.create("JAVA_COMPLETION");
|
||||
public static final Key<Condition<String>> NAME_FILTER = Key.create("NAME_FILTER");
|
||||
|
||||
private JavaCompletionHints() {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.psi.impl.source;
|
||||
|
||||
import com.intellij.codeInsight.completion.scope.JavaCompletionHints;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
@@ -341,11 +340,10 @@ public abstract class PsiJavaFileBaseImpl extends PsiFileImpl implements PsiJava
|
||||
final PsiImportStaticStatement[] importStaticStatements = importList.getImportStaticStatements();
|
||||
if (importStaticStatements.length > 0) {
|
||||
final StaticImportFilteringProcessor staticImportProcessor = new StaticImportFilteringProcessor(processor);
|
||||
final boolean forCompletion = Boolean.TRUE == processor.getHint(JavaCompletionHints.JAVA_COMPLETION);
|
||||
|
||||
// single member processing
|
||||
for (PsiImportStaticStatement importStaticStatement : importStaticStatements) {
|
||||
if (importStaticStatement.isOnDemand() || forCompletion) continue;
|
||||
if (importStaticStatement.isOnDemand()) continue;
|
||||
final PsiJavaCodeReferenceElement reference = importStaticStatement.getImportReference();
|
||||
if (reference != null) {
|
||||
final JavaResolveResult[] results = reference.multiResolve(false);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import static Util2.AIOInner;
|
||||
|
||||
public class Util2 {
|
||||
public static class AIOInner {}
|
||||
}
|
||||
|
||||
class Test {
|
||||
AIO<caret>
|
||||
}
|
||||
+8
-3
@@ -22,8 +22,8 @@ import com.intellij.codeInsight.lookup.LookupElementPresentation
|
||||
import com.intellij.codeInsight.lookup.LookupManager
|
||||
import com.intellij.lang.java.JavaLanguage
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.PsiMethod
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager
|
||||
import com.intellij.psi.codeStyle.CommonCodeStyleSettings
|
||||
|
||||
@@ -973,6 +973,11 @@ public class ListUtils {
|
||||
doTest('\n')
|
||||
}
|
||||
|
||||
public void testStaticallyImportedInner() throws Throwable {
|
||||
configure()
|
||||
assertStringItems('AIOInner', 'ArrayIndexOutOfBoundsException')
|
||||
}
|
||||
|
||||
public void testClassNameInIfBeforeIdentifier() throws Throwable {
|
||||
myFixture.addClass("public class ABCDEFFFFF {}")
|
||||
doTest('\n')
|
||||
@@ -1311,7 +1316,7 @@ public class ListUtils {
|
||||
|
||||
public void testListArrayListCast() { doTest('\n') }
|
||||
public void testInterfaceImplementationNoCast() { doTest() }
|
||||
public void testStaticallyImportedMethodsBeforeExpression() { doTest('\n') }
|
||||
public void testStaticallyImportedMethodsBeforeExpression() { doTest() }
|
||||
public void testInnerChainedReturnType() { doTest() }
|
||||
public void testOverwriteGenericsAfterNew() { doTest('\n') }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user