Remove usage of idea file systems for checking js libraries

The removed code is probably an outdated code from the age when Kotlin
compiler was using VirtualFiles for operating. Previously the links were
stored and passed further, but now it is only some additional check
(files are unused after the check) with an implicit dependency to
IDEA internals.

The deleted check could probably be responsible for handling references
to JS libraries because of the working compiler daemon.

The code was spotted during an investigation for the
2bf22caeb7 commit (there's a detailed
description in the commit message).
This commit is contained in:
Nikolay Krasko
2020-12-03 22:51:00 +03:00
committed by TeamCityServer
parent c959ad7911
commit 5f91f79382
@@ -164,9 +164,6 @@ public class JsConfig {
return false;
}
VirtualFileSystem fileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.FILE_PROTOCOL);
VirtualFileSystem jarFileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JAR_PROTOCOL);
Set<String> modules = new HashSet<>();
boolean skipMetadataVersionCheck = getLanguageVersionSettings().getFlag(AnalysisFlags.getSkipMetadataVersionCheck());
@@ -174,26 +171,12 @@ public class JsConfig {
for (String path : libraries) {
if (librariesToSkip != null && librariesToSkip.contains(path)) continue;
VirtualFile file;
File filePath = new File(path);
if (!filePath.exists()) {
report.error("Path '" + path + "' does not exist");
return true;
}
if (path.endsWith(".jar") || path.endsWith(".zip")) {
file = jarFileSystem.findFileByPath(path + URLUtil.JAR_SEPARATOR);
}
else {
file = fileSystem.findFileByPath(path);
}
if (file == null) {
report.error("File '" + path + "' does not exist or could not be read");
return true;
}
List<KotlinJavascriptMetadata> metadataList = KotlinJavascriptMetadataUtils.loadMetadata(path);
if (metadataList.isEmpty()) {
report.warning("'" + path + "' is not a valid Kotlin Javascript library");