make FileIndexFacade.shouldBeFound no-op
authorpeter <peter@jetbrains.com>
Fri, 13 Sep 2019 13:49:11 +0000 (15:49 +0200)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 13 Sep 2019 14:02:00 +0000 (14:02 +0000)
because the scope should control the files to be found by indices

GitOrigin-RevId: 742330010fd8bc2214ca080d1d96cd75401cf3c6

platform/core-api/src/com/intellij/openapi/roots/FileIndexFacade.java
platform/indexing-impl/src/com/intellij/psi/impl/cache/impl/IndexCacheManagerImpl.java
platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java

index 69994d478e39e49b5466b07301254a082b3e4b8f..13a5ef7447a8864e67c4599a9f972d76c63e4a64 100644 (file)
@@ -64,8 +64,13 @@ public abstract class FileIndexFacade {
    */
   public abstract boolean isValidAncestor(@NotNull VirtualFile baseDir, @NotNull VirtualFile child);
 
+  /**
+   * @deprecated always returns true, just remove the calls
+   */
+  @SuppressWarnings("unused")
+  @Deprecated
   public boolean shouldBeFound(@NotNull GlobalSearchScope scope, @NotNull VirtualFile virtualFile) {
-    return scope.isSearchOutsideRootModel() || isInContent(virtualFile) || isInLibrarySource(virtualFile);
+    return true;
   }
 
   @NotNull public abstract ModificationTracker getRootModificationTracker();
index 9be05ac680d225a0d6d0429ef2c8d41710ceabf6..68bb2a8aa98e1fff02e05f53c395d2d49f788aba 100644 (file)
@@ -82,7 +82,7 @@ public class IndexCacheManagerImpl implements CacheManager{
           public boolean process(@NotNull final VirtualFile file, final Integer value) {
             ProgressIndicatorProvider.checkCanceled();
             final int mask = value.intValue();
-            if ((mask & occurrenceMask) != 0 && index.shouldBeFound(scope, file)) {
+            if ((mask & occurrenceMask) != 0) {
               if (!fileProcessor.process(file)) return false;
             }
             return true;
index 9b2cafa7f4ba1f8402f37db1f73345cf777a6f92..65798c75e6c41c962a62ae752e7ca83e5e054ff0 100644 (file)
@@ -993,8 +993,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper {
                                                        @NotNull final Processor<? super VirtualFile> processor) {
     final FileIndexFacade index = FileIndexFacade.getInstance(project);
     return DumbService.getInstance(project).runReadActionInSmartMode(
-      () -> FileBasedIndex.getInstance().processFilesContainingAllKeys(IdIndex.NAME, keys, scope, checker,
-                                                                        file -> !index.shouldBeFound(scope, file) || processor.process(file)));
+      () -> FileBasedIndex.getInstance().processFilesContainingAllKeys(IdIndex.NAME, keys, scope, checker, processor));
   }
 
   @NotNull