[indices] do not request indices for delegated scope with empty base

deep unwrap

GitOrigin-RevId: a673b5049f58a14111a328ff6ec3565103f0d889
This commit is contained in:
Anna Kozlova
2021-08-02 16:18:47 +00:00
committed by intellij-monorepo-bot
parent 8b9143ff22
commit 35d673b383
2 changed files with 5 additions and 1 deletions
@@ -114,4 +114,8 @@ public class DelegatingGlobalSearchScope extends GlobalSearchScope {
public GlobalSearchScope getDelegate() {
return myBaseScope;
}
public GlobalSearchScope unwrap() {
return myBaseScope instanceof DelegatingGlobalSearchScope ? ((DelegatingGlobalSearchScope)myBaseScope).unwrap() : myBaseScope;
}
}
@@ -777,7 +777,7 @@ public final class FileBasedIndexImpl extends FileBasedIndexEx {
return true; //indexed eagerly in foreground while building unindexed file list
}
if (filter == GlobalSearchScope.EMPTY_SCOPE ||
filter instanceof DelegatingGlobalSearchScope && ((DelegatingGlobalSearchScope)filter).getDelegate() == GlobalSearchScope.EMPTY_SCOPE) {
filter instanceof DelegatingGlobalSearchScope && ((DelegatingGlobalSearchScope)filter).unwrap() == GlobalSearchScope.EMPTY_SCOPE) {
return false;
}
if (project == null) {