get rid of DaemonCodeAnalyzer#updateVisibleHighlighters usages

This commit is contained in:
Daniil Ovchinnikov
2018-08-06 16:02:08 +03:00
parent 44a58d2207
commit 8d9afa2622
4 changed files with 4 additions and 22 deletions
@@ -15,7 +15,6 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.daemon.QuickFixBundle;
import com.intellij.codeInsight.daemon.impl.analysis.HighlightControlFlowUtil;
import com.intellij.codeInsight.intention.IntentionAction;
@@ -149,8 +148,6 @@ public class BringVariableIntoScopeFix implements IntentionAction {
if (HighlightControlFlowUtil.checkVariableInitializedBeforeUsage(myUnresolvedReference, addedVar, new THashMap<>(), file) != null) {
initialize(addedVar);
}
DaemonCodeAnalyzer.getInstance(project).updateVisibleHighlighters(editor);
}
private static void initialize(final PsiLocalVariable variable) throws IncorrectOperationException {
@@ -8,7 +8,6 @@ import com.intellij.codeInsight.CodeInsightSettings;
import com.intellij.codeInsight.completion.CompletionMemory;
import com.intellij.codeInsight.completion.JavaCompletionUtil;
import com.intellij.codeInsight.completion.JavaMethodCallElement;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.daemon.impl.ParameterHintsPresentationManager;
import com.intellij.codeInsight.hint.ParameterInfoController;
import com.intellij.codeInsight.hints.ParameterHintsPass;
@@ -47,8 +46,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.*;
/**
* @author Maxim.Mossienko
@@ -102,7 +101,6 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
CandidateInfo[] candidates = getMethods(argumentList);
if (candidates.length == 0) {
DaemonCodeAnalyzer.getInstance(context.getProject()).updateVisibleHighlighters(context.getEditor());
return null;
}
context.setItemsToShow(candidates);
@@ -3,7 +3,6 @@
package com.intellij.codeInsight;
import com.intellij.codeInsight.completion.CompletionUtil;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.lookup.Lookup;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupManager;
@@ -347,7 +346,7 @@ public class TargetElementUtil extends TargetElementUtilBase {
@Nullable
private PsiElement getReferenceOrReferencedElement(PsiFile file, Editor editor, int flags, int offset) {
PsiElement result = doGetReferenceOrReferencedElement(file, editor, flags, offset);
PsiElement result = doGetReferenceOrReferencedElement(editor, flags, offset);
PsiElement languageElement = file.findElementAt(offset);
Language language = languageElement != null ? languageElement.getLanguage() : file.getLanguage();
TargetElementEvaluatorEx2 evaluator = getElementEvaluatorsEx2(language);
@@ -358,7 +357,7 @@ public class TargetElementUtil extends TargetElementUtilBase {
}
@Nullable
private PsiElement doGetReferenceOrReferencedElement(PsiFile file, Editor editor, int flags, int offset) {
private static PsiElement doGetReferenceOrReferencedElement(Editor editor, int flags, int offset) {
PsiReference ref = findReference(editor, offset);
if (ref == null) return null;
@@ -369,17 +368,7 @@ public class TargetElementUtil extends TargetElementUtilBase {
if (element != null) return element;
}
PsiManager manager = file.getManager();
PsiElement refElement = ref.resolve();
if (refElement == null) {
if (ApplicationManager.getApplication().isDispatchThread()) {
DaemonCodeAnalyzer.getInstance(manager.getProject()).updateVisibleHighlighters(editor);
}
return null;
}
else {
return refElement;
}
return ref.resolve();
}
@Override
@@ -16,7 +16,6 @@
package com.intellij.codeInsight.hint.api.impls;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.MutableLookupElement;
import com.intellij.lang.parameterInfo.*;
@@ -68,7 +67,6 @@ public class XmlParameterInfoHandler implements ParameterInfoHandler<XmlTag,XmlE
final XmlElementDescriptor descriptor = tag != null ? tag.getDescriptor() : null;
if (descriptor == null) {
DaemonCodeAnalyzer.getInstance(context.getProject()).updateVisibleHighlighters(context.getEditor());
return null;
}