mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
deprecate FilenameIndex.NAME
GitOrigin-RevId: d500a2ea0e47ab78733dcae468c3b9c2f4b9e510
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1ad9a131f7
commit
8024ab5be8
@@ -1144,7 +1144,7 @@ class IndexTest extends JavaCodeInsightFixtureTestCase {
|
||||
|
||||
void "test indexed state for file without content requiring indices"() {
|
||||
def scope = GlobalSearchScope.allScope(getProject())
|
||||
FileBasedIndex.instance.ensureUpToDate(FilenameIndex.NAME, project, scope)
|
||||
FileBasedIndex.instance.ensureUpToDate(FileTypeIndex.NAME, project, scope)
|
||||
|
||||
def files = FilenameIndex.getFilesByName(getProject(), "intellij.exe", scope)
|
||||
def file = assertOneElement(files).virtualFile
|
||||
@@ -1152,7 +1152,7 @@ class IndexTest extends JavaCodeInsightFixtureTestCase {
|
||||
assertTrue(((VirtualFileSystemEntry)file).isFileIndexed())
|
||||
|
||||
WriteCommandAction.runWriteCommandAction(getProject(), { file.rename(this, 'intellij2.exe') })
|
||||
FileBasedIndex.instance.ensureUpToDate(FilenameIndex.NAME, project, scope)
|
||||
FileBasedIndex.instance.ensureUpToDate(FileTypeIndex.NAME, project, scope)
|
||||
assertTrue(((VirtualFileSystemEntry)file).isFileIndexed())
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ import java.util.Set;
|
||||
|
||||
|
||||
public final class FilenameIndex {
|
||||
/** @deprecated Use {@link FilenameIndex} methods instead **/
|
||||
@Deprecated
|
||||
@ApiStatus.Internal
|
||||
public static final ID<String, Void> NAME = ID.create("FilenameIndex");
|
||||
|
||||
|
||||
@@ -12,8 +12,10 @@ import com.intellij.openapi.util.ModificationTracker;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.UniqueNameBuilder;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFilePathWrapper;
|
||||
import com.intellij.openapi.vfs.newvfs.ManagingFS;
|
||||
import com.intellij.psi.search.FilenameIndex;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
@@ -123,7 +125,10 @@ final class UniqueVFilePathBuilderImpl extends UniqueVFilePathBuilder {
|
||||
|
||||
@NotNull
|
||||
private static ModificationTracker getFilenameIndexModificationTracker(@NotNull Project project) {
|
||||
return () -> disableIndexUpToDateCheckInEdt(() -> FileBasedIndex.getInstance().getIndexModificationStamp(FilenameIndex.NAME, project));
|
||||
if (Registry.is("indexing.filename.over.vfs")) {
|
||||
return () -> ManagingFS.getInstance().getModificationCount();
|
||||
}
|
||||
return () -> disableIndexUpToDateCheckInEdt(() -> FileBasedIndex.getInstance().getIndexModificationStamp(FilenameIndex.NAME, project)); //
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user