mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
return empty scope when search target has become invalid (PIEAE EA-113928, EA-111728)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -99,6 +99,8 @@ public class ReferencesSearch extends ExtensibleQueryFactory<PsiReference, Refer
|
||||
|
||||
SearchScope scope = myEffectiveScope;
|
||||
if (scope == null) {
|
||||
if (!myElementToSearch.isValid()) return GlobalSearchScope.EMPTY_SCOPE;
|
||||
|
||||
SearchScope useScope = PsiSearchHelper.getInstance(myElementToSearch.getProject()).getUseScope(myElementToSearch);
|
||||
myEffectiveScope = scope = myScope.intersectWith(useScope);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user