[external system api][IDEA-347061] Do not refresh VFS from LibraryDataService

This action seems unnecessary because the Workspace Model and Indexes should take care of synchronizing the files between disk and VFS.

GitOrigin-RevId: 3131e5c8406a582e1216a6e8f8a8a03fde86a40e
This commit is contained in:
Alexander.Glukhov
2024-10-14 11:18:17 +02:00
committed by intellij-monorepo-bot
parent 12e1eb0436
commit 2c871b531d

View File

@@ -32,7 +32,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.io.File; import java.io.File;
import java.nio.file.Path;
import java.util.*; import java.util.*;
@ApiStatus.Internal @ApiStatus.Internal
@@ -108,17 +107,6 @@ public final class LibraryDataService extends AbstractProjectDataService<Library
return null; return null;
} }
private static void refreshVfsFiles(Collection<? extends File> files) {
VirtualFileManager virtualFileManager = VirtualFileManager.getInstance();
for (File file : files) {
Path path = file.toPath();
// search for jar file first otherwise lib root won't be found!
if (virtualFileManager.findFileByNioPath(path) == null) {
virtualFileManager.refreshAndFindFileByNioPath(path);
}
}
}
static @NotNull Map<OrderRootType, Collection<File>> prepareLibraryFiles(@NotNull LibraryData data) { static @NotNull Map<OrderRootType, Collection<File>> prepareLibraryFiles(@NotNull LibraryData data) {
Map<OrderRootType, Collection<File>> result = new HashMap<>(); Map<OrderRootType, Collection<File>> result = new HashMap<>();
for (LibraryPathType pathType: LibraryPathType.values()) { for (LibraryPathType pathType: LibraryPathType.values()) {
@@ -131,7 +119,6 @@ public final class LibraryDataService extends AbstractProjectDataService<Library
continue; continue;
} }
List<File> files = ContainerUtil.map(paths, File::new); List<File> files = ContainerUtil.map(paths, File::new);
refreshVfsFiles(files);
result.put(orderRootType, files); result.put(orderRootType, files);
} }
return result; return result;