mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[indexes] IJPL-2966: refactoring FileBasedIndexImpl.ACCEPT_ALL
GitOrigin-RevId: 7b3af1f7f6398a6e5aa493fdf8617348757bebfe
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3b5c423585
commit
2b186f0cf3
@@ -2121,23 +2121,24 @@ public final class FileBasedIndexImpl extends FileBasedIndexEx {
|
||||
CorruptionMarker.requestInvalidation();
|
||||
}
|
||||
|
||||
private static final @NotNull IntPredicate ACCEPT_ALL = (fileId -> true);
|
||||
@Override
|
||||
@Internal
|
||||
public @NotNull IntPredicate getAccessibleFileIdFilter(@Nullable Project project) {
|
||||
boolean dumb = ActionUtil.isDumbMode(project);
|
||||
if (!dumb) return f -> true;
|
||||
if (!dumb) return ACCEPT_ALL;
|
||||
|
||||
if (DumbServiceImpl.ALWAYS_SMART && project != null && UnindexedFilesUpdater.isScanningInProgress(project)) {
|
||||
return f -> true;
|
||||
return ACCEPT_ALL;
|
||||
}
|
||||
|
||||
DumbModeAccessType dumbModeAccessType = getCurrentDumbModeAccessType(project);
|
||||
if (dumbModeAccessType == null) {
|
||||
//throw new IllegalStateException("index access is not allowed in dumb mode");
|
||||
return __ -> true;
|
||||
return ACCEPT_ALL;
|
||||
}
|
||||
|
||||
if (dumbModeAccessType == DumbModeAccessType.RAW_INDEX_DATA_ACCEPTABLE) return f -> true;
|
||||
if (dumbModeAccessType == DumbModeAccessType.RAW_INDEX_DATA_ACCEPTABLE) return ACCEPT_ALL;
|
||||
|
||||
assert dumbModeAccessType == DumbModeAccessType.RELIABLE_DATA_ONLY;
|
||||
return fileId -> !myFilesToUpdateCollector.containsFileId(fileId);
|
||||
|
||||
Reference in New Issue
Block a user