From 9adb5f32ca0f3967fa0203f6370608eee352c05b Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 22 Jul 2016 17:50:11 +0300 Subject: [PATCH] do not scan compiled scope: EA-86173 - assert: LowLevelSearchUtil.a --- .../search/VariableInIncompleteCodeSearcher.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java index 00323f3277ec..c797262e69fc 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java @@ -18,9 +18,13 @@ package com.intellij.psi.impl.search; import com.intellij.openapi.application.QueryExecutorBase; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; -import com.intellij.psi.search.*; +import com.intellij.psi.search.LocalSearchScope; +import com.intellij.psi.search.PsiSearchHelper; +import com.intellij.psi.search.SearchScope; +import com.intellij.psi.search.UsageSearchContext; import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.util.Processor; +import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; /** @@ -46,6 +50,14 @@ public class VariableInIncompleteCodeSearcher extends QueryExecutorBase !(e instanceof PsiCompiledElement)); + if (sourceElements.length != elements.length) { + if (sourceElements.length == 0) return; + scope = new LocalSearchScope(sourceElements); + } + } PsiElement[] elements = ((LocalSearchScope)scope).getScope(); if (elements.length == 0) return;