return empty scope when search target has become invalid (PIEAE EA-113928, EA-111728)

This commit is contained in:
peter
2018-11-12 12:09:28 +01:00
parent dda2cf8bca
commit ac8f3431da
2 changed files with 4 additions and 0 deletions

View File

@@ -88,6 +88,8 @@ public class MethodReferencesSearch extends ExtensibleQueryFactory<PsiReference,
public SearchScope getEffectiveSearchScope () {
SearchScope scope = myEffectiveScope;
if (scope == null) {
if (!myMethod.isValid()) return GlobalSearchScope.EMPTY_SCOPE;
myEffectiveScope = scope = myScope.intersectWith(PsiSearchHelper.getInstance(myMethod.getProject()).getUseScope(myMethod));
}
return scope;