// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.indexing.roots;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ContentIterator;
import com.intellij.util.containers.ConcurrentBitSet;
import org.jetbrains.annotations.ApiStatus;

/**
 * Provides files to be indexed for a project structure entity (module, library, SDK, etc.)
 * Allows the indexing infrastructure to prioritize indexing by some predicate.
 *
 * @see [ModuleIndexableFilesProvider]
 * @see [LibraryIndexableFilesProvider]
 */
@ApiStatus.Internal
public interface IndexableFilesProvider {

  /**
   * Presentable name that can be shown in logs and used for debugging purposes.
   */
  String getDebugName();

  /**
   * Presentable text shown in progress indicator during indexing of files of this provider.
   */
  String getIndexingProgressText();

  /**
   * Presentable text shown in progress indicator during traversing of files of this provider.
   */
  String getRootsScanningProgressText();

  /**
   * Iterates through all files and directories corresponding to this provider.
   * Skips already visited files by looking to [visitedFileSet].
   * @return `false` if [fileIterator] has stopped iteration by returning `false`, `true` otherwise.
   */
  boolean iterateFiles(Project project, ContentIterator fileIterator, ConcurrentBitSet visitedFileSet);
}

@@ -297,84 +297,309 @@
 lij.
-util.containers.ConcurrentBitSet;%0Aimport org.jetbrains.annotations.ApiStatus
+openapi.util.NlsContexts;%0Aimport com.intellij.openapi.vfs.VirtualFile;%0Aimport com.intellij.openapi.vfs.VirtualFileWithId;%0Aimport com.intellij.util.containers.ConcurrentBitSet;%0Aimport org.jetbrains.annotations.ApiStatus;%0Aimport org.jetbrains.annotations.NonNls;%0Aimport org.jetbrains.annotations.NotNull
 ;%0A%0A/
@@ -1007,32 +1007,42 @@
 purposes.%0A   */%0A
+  @NonNls%0A
   String getDebu
@@ -1148,32 +1148,60 @@
 provider.%0A   */%0A
+  @NlsContexts.ProgressText%0A
   String getInde
@@ -1328,16 +1328,44 @@
 .%0A   */%0A
+  @NlsContexts.ProgressText%0A
   String
@@ -1493,67 +1493,692 @@
   * 
-Skips already visited files by looking to %5BvisitedFileSet%5D.
+%3Cbr /%3E%0A   * The %7B@param visitedFileSet%7D is used to store positive %7B@link VirtualFileWithId#getId()%7D of Virtual Files,%0A   * the implementation is free to skip other %7B@link VirtualFile%7D implementations and%0A   * non-positive %7B@link VirtualFileWithId#getId()%7D.%0A   * The %7B@param visitedFileSet%7D is used to implement filtering to skip already visited files by looking to %5BvisitedFileSet%5D.%0A   * %3Cbr /%3E%0A   * The %7B@param fileIterator%7D should be invoked on every new file (with respect to %7B@oaram visitedFileSet%7D,%0A   * should the %7B@link ContentIterator#processFile(VirtualFile)%7D returns false, the processing should be%0A   * stopped and the %7B@code false%7D should be returned from the method.%0A   *
 %0A   
@@ -2304,16 +2304,25 @@
 teFiles(
+@NotNull 
 Project 
@@ -2333,38 +2333,102 @@
 ect,
- ContentIterator fileIterator,
+%0A                       @NotNull ContentIterator fileIterator,%0A                       @NotNull
  Con

add javadoc and annotations