Don't consider libraries with empty source roots as JS libraries
#KT-3425 Fixed
This commit is contained in:
@@ -54,10 +54,6 @@ public class JSLibraryStdPresentationProvider extends LibraryPresentationProvide
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isOldJSStandardLibrary(classesRoots)) {
|
||||
return new LibraryVersionProperties(null);
|
||||
}
|
||||
|
||||
for (VirtualFile root : classesRoots) {
|
||||
if (root.getName().equals(PathUtil.JS_LIB_JAR_NAME)) {
|
||||
assert JsHeaderLibraryPresentationProvider.getInstance().detect(classesRoots) != null : "StdLib should also be detected as headers library";
|
||||
@@ -75,9 +71,4 @@ public class JSLibraryStdPresentationProvider extends LibraryPresentationProvide
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: Deprecated - remove after some iterations
|
||||
static boolean isOldJSStandardLibrary(@NotNull List<VirtualFile> classesRoots) {
|
||||
return classesRoots.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,6 @@ public class JsHeaderLibraryPresentationProvider extends LibraryPresentationProv
|
||||
return null;
|
||||
}
|
||||
|
||||
if (JSLibraryStdPresentationProvider.isOldJSStandardLibrary(classesRoots)) {
|
||||
return new LibraryVersionProperties(null);
|
||||
}
|
||||
|
||||
for (VirtualFile file : classesRoots) {
|
||||
CommonProcessors.FindFirstProcessor<VirtualFile> findKTProcessor = new CommonProcessors.FindFirstProcessor<VirtualFile>() {
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,6 @@ import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.plugin.versions.KotlinRuntimeLibraryUtil;
|
||||
import org.jetbrains.k2js.config.EcmaVersion;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -126,7 +125,7 @@ public class KotlinFrameworkDetector {
|
||||
ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(new Processor<Library>() {
|
||||
@Override
|
||||
public boolean process(Library library) {
|
||||
if (JSLibraryStdPresentationProvider.getInstance().detect(Arrays.asList(library.getFiles(OrderRootType.CLASSES))) != null) {
|
||||
if (LibraryPresentationProviderUtil.isDetected(JSLibraryStdPresentationProvider.getInstance(), library)) {
|
||||
jsLibrary.set(library);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user