mark Java completion contributors as dumb-aware to run them during indexing without...
authorPeter Gromov <peter@jetbrains.com>
Mon, 10 Aug 2020 16:37:49 +0000 (18:37 +0200)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Mon, 10 Aug 2020 17:32:23 +0000 (17:32 +0000)
GitOrigin-RevId: eae0e290a86212c4064d29695d68a02a4a7a99f0

12 files changed:
java/compiler/impl/src/com/intellij/compiler/chainsSearch/completion/MethodChainCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JShellCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaClassReferenceCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaDocCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodMergingContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java
java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicCompletionContributor.java
java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/JavaMethodHandleCompletionContributor.java
java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/JavaReflectionCompletionContributor.java

index ab90d5cd78d2679bd1d55082ee74da3f22594346..ac8581ed3314a50789f45030963967127eaf7484 100644 (file)
@@ -14,6 +14,7 @@ import com.intellij.compiler.chainsSearch.context.ChainCompletionContext;
 import com.intellij.compiler.chainsSearch.context.ChainSearchTarget;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.registry.Registry;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.patterns.PatternCondition;
@@ -34,7 +35,7 @@ import java.util.stream.Collectors;
 
 import static com.intellij.patterns.PsiJavaPatterns.*;
 
-public final class MethodChainCompletionContributor extends CompletionContributor {
+public final class MethodChainCompletionContributor extends CompletionContributor implements DumbAware {
   public static final String REGISTRY_KEY = "compiler.ref.chain.search";
   private static final Logger LOG = Logger.getInstance(MethodChainCompletionContributor.class);
   private static final boolean UNIT_TEST_MODE = ApplicationManager.getApplication().isUnitTestMode();
index f1617e80d92e2dfc3f15a62b05e1f16ded8d16e6..b396003035658439af7c76fd65004953df71241e 100644 (file)
  */
 package com.intellij.codeInsight.completion;
 
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.psi.PsiJShellSyntheticElement;
 import org.jetbrains.annotations.NotNull;
 
 /**
  * @author Eugene Zhuravlev
  */
-public class JShellCompletionContributor extends CompletionContributor {
+public class JShellCompletionContributor extends CompletionContributor implements DumbAware {
   @Override
   public void fillCompletionVariants(@NotNull final CompletionParameters parameters, @NotNull final CompletionResultSet resultSet) {
     resultSet.runRemainingContributors(parameters, r -> {
index 73f1bce5454032f707750c40d9298067daa2696f..a39cee1cb17e3f89710506434d0f27dc4ecbdcdb 100644 (file)
@@ -10,6 +10,7 @@ import com.intellij.lang.java.JavaLanguage;
 import com.intellij.openapi.actionSystem.IdeActions;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.keymap.KeymapUtil;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.Condition;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.patterns.ElementPattern;
@@ -46,7 +47,7 @@ import static com.intellij.patterns.PsiJavaPatterns.psiElement;
 /**
  * @author peter
  */
-public class JavaClassNameCompletionContributor extends CompletionContributor {
+public class JavaClassNameCompletionContributor extends CompletionContributor implements DumbAware {
   public static final PsiJavaElementPattern.Capture<PsiElement> AFTER_NEW = psiElement().afterLeaf(PsiKeyword.NEW);
   private static final PsiJavaElementPattern.Capture<PsiElement> IN_TYPE_PARAMETER =
       psiElement().afterLeaf(PsiKeyword.EXTENDS, PsiKeyword.SUPER, "&").withParent(
index d4d08611229bb530b68ed8632255a79925ebb09a..71f09f845d6dae458c79e420a57f3a270b1892a5 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.codeInsight.completion;
 import com.intellij.java.JavaBundle;
 import com.intellij.openapi.actionSystem.IdeActions;
 import com.intellij.openapi.keymap.KeymapUtil;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
@@ -32,7 +33,7 @@ import org.jetbrains.annotations.Nullable;
 /**
  * @author peter
  */
-public class JavaClassReferenceCompletionContributor extends CompletionContributor {
+public class JavaClassReferenceCompletionContributor extends CompletionContributor implements DumbAware {
   @Override
   public void duringCompletion(@NotNull CompletionInitializationContext context) {
     JavaClassReference reference = findJavaClassReference(context.getFile(), context.getStartOffset());
index 7c7abf08b5ed43ff9b4bced203217c89b8b80457..9600dded415114487e35544db42df4bf6ed29f98 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.keymap.KeymapUtil;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.ModuleRootManager;
 import com.intellij.openapi.util.Condition;
@@ -67,7 +68,7 @@ import static com.intellij.patterns.PsiJavaPatterns.*;
 /**
  * @author peter
  */
-public class JavaCompletionContributor extends CompletionContributor {
+public class JavaCompletionContributor extends CompletionContributor implements DumbAware {
   private static final ElementPattern<PsiElement> UNEXPECTED_REFERENCE_AFTER_DOT =
     psiElement().afterLeaf(".").insideStarting(psiExpressionStatement());
   private static final PsiNameValuePairPattern NAME_VALUE_PAIR =
index 07852f3f1b803d142b4213fcb3be14b27788db61..6af41d4c14a7414210ea6b8012b3385edc37c700 100644 (file)
@@ -17,6 +17,7 @@ import com.intellij.codeInspection.javaDoc.JavadocHighlightUtil;
 import com.intellij.lang.java.JavaLanguage;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.*;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.Conditions;
@@ -48,7 +49,7 @@ import java.util.*;
 import static com.intellij.patterns.PlatformPatterns.psiElement;
 import static com.intellij.patterns.StandardPatterns.string;
 
-public class JavaDocCompletionContributor extends CompletionContributor {
+public class JavaDocCompletionContributor extends CompletionContributor implements DumbAware {
   private static final Logger LOG = Logger.getInstance(JavaDocCompletionContributor.class);
   private static final @NonNls String VALUE_TAG = "value";
   private static final @NonNls String LINK_TAG = "link";
index 8348f84afda9a2c38acf6f062ae540b581a5573b..c82d4fc8e7548584594d320837755f8c47a4a4c0 100644 (file)
@@ -8,6 +8,7 @@ import com.intellij.codeInsight.lookup.*;
 import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
 import com.intellij.featureStatistics.FeatureUsageTracker;
 import com.intellij.lang.ASTNode;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.patterns.ElementPattern;
@@ -45,7 +46,7 @@ import static com.intellij.patterns.StandardPatterns.or;
 /**
  * @author peter
  */
-public class JavaMemberNameCompletionContributor extends CompletionContributor {
+public class JavaMemberNameCompletionContributor extends CompletionContributor implements DumbAware {
   public static final ElementPattern<PsiElement> INSIDE_TYPE_PARAMS_PATTERN = psiElement().
     afterLeaf(psiElement().withText("?").andOr(
       psiElement().afterLeaf("<", ","),
index 87f3ea04ae2640d128203cbcbab887ed364e7fc2..25c4281770ad96b956900a8e414d942a20438748 100644 (file)
@@ -3,6 +3,7 @@ package com.intellij.codeInsight.completion;
 
 import com.intellij.codeInsight.hint.ParameterInfoController;
 import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.Key;
 import com.intellij.psi.PsiMethod;
 import com.intellij.psi.PsiType;
@@ -16,7 +17,7 @@ import java.util.Objects;
 /**
  * @author peter
  */
-public class JavaMethodMergingContributor extends CompletionContributor {
+public class JavaMethodMergingContributor extends CompletionContributor implements DumbAware {
   static final Key<Boolean> MERGED_ELEMENT = Key.create("merged.element");
 
   @Override
index 43628204f4e838834ce6c8f6a9e17c412b7f253f..1251f15f00a0ff57a2b0924a0f18e0cfdeed4921 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
 import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
 import com.intellij.codeInsight.lookup.LookupElement;
 import com.intellij.codeInsight.lookup.TailTypeDecorator;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.*;
@@ -41,7 +42,7 @@ import static com.intellij.patterns.PsiJavaPatterns.psiElement;
 /**
  * @author peter
  */
-public class JavaNoVariantsDelegator extends CompletionContributor {
+public class JavaNoVariantsDelegator extends CompletionContributor implements DumbAware {
   @Override
   public void fillCompletionVariants(@NotNull final CompletionParameters parameters, @NotNull final CompletionResultSet result) {
     ResultTracker tracker = new ResultTracker(result) {
index 7448d0aa33870c874d58c6f990bce6b65e29db31..1bd4067335522200e527529ff06119a4229d6251 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.codeInsight.lookup.LookupElement;
 import com.intellij.codeInsight.lookup.LookupElementBuilder;
 import com.intellij.codeInsight.lookup.LookupItemUtil;
 import com.intellij.codeInsight.lookup.VariableLookupItem;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.Pair;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.psi.*;
@@ -36,7 +37,7 @@ import java.util.*;
 
 import static com.intellij.patterns.PlatformPatterns.psiElement;
 
-public class MagicCompletionContributor extends CompletionContributor {
+public class MagicCompletionContributor extends CompletionContributor implements DumbAware {
   private static final ElementPattern<PsiElement> IN_METHOD_CALL_ARGUMENT =
     psiElement().withParent(psiElement(PsiReferenceExpression.class).inside(psiElement(PsiExpressionList.class).withParent(PsiCall.class)));
   private static final ElementPattern<PsiElement> IN_BINARY_COMPARISON =
index c762156f087389f41d58331ee931347a39eae8e8..5535bcb39e687fd5301d26ee7c2aad17408b1bfa 100644 (file)
@@ -4,6 +4,7 @@ package com.intellij.psi.impl.source.resolve.reference.impl;
 import com.intellij.codeInsight.completion.*;
 import com.intellij.codeInsight.lookup.ExpressionLookupItem;
 import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.patterns.PsiJavaElementPattern;
 import com.intellij.patterns.PsiMethodPattern;
@@ -29,7 +30,7 @@ import static com.intellij.psi.impl.source.resolve.reference.impl.JavaReflection
 /**
  * @author Pavel.Dolgov
  */
-public class JavaMethodHandleCompletionContributor extends CompletionContributor {
+public class JavaMethodHandleCompletionContributor extends CompletionContributor implements DumbAware {
 
   // MethodHandle for constructors and methods
   private static final Set<String> METHOD_HANDLE_FACTORY_NAMES = ContainerUtil.immutableSet(
index 3ba7ff60ba1b0ee5fddcceba8cdf6de03cef1bd4..0b2bd27c4c5c3d2aad1c417588246f4de332d6a4 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.codeInsight.AnnotationUtil;
 import com.intellij.codeInsight.completion.*;
 import com.intellij.codeInsight.lookup.LookupElement;
 import com.intellij.codeInsight.lookup.LookupElementBuilder;
+import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.patterns.PatternCondition;
@@ -40,7 +41,7 @@ import static com.intellij.psi.impl.source.resolve.reference.impl.JavaReflection
 /**
  * @author Pavel.Dolgov
  */
-public class JavaReflectionCompletionContributor extends CompletionContributor {
+public class JavaReflectionCompletionContributor extends CompletionContributor implements DumbAware {
   private static final String CONSTRUCTOR = "getConstructor";
   private static final String DECLARED_CONSTRUCTOR = "getDeclaredConstructor";
   private static final String ANNOTATION = "getAnnotation";