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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isOldJSStandardLibrary(classesRoots)) {
|
|
||||||
return new LibraryVersionProperties(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (VirtualFile root : classesRoots) {
|
for (VirtualFile root : classesRoots) {
|
||||||
if (root.getName().equals(PathUtil.JS_LIB_JAR_NAME)) {
|
if (root.getName().equals(PathUtil.JS_LIB_JAR_NAME)) {
|
||||||
assert JsHeaderLibraryPresentationProvider.getInstance().detect(classesRoots) != null : "StdLib should also be detected as headers library";
|
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;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JSLibraryStdPresentationProvider.isOldJSStandardLibrary(classesRoots)) {
|
|
||||||
return new LibraryVersionProperties(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (VirtualFile file : classesRoots) {
|
for (VirtualFile file : classesRoots) {
|
||||||
CommonProcessors.FindFirstProcessor<VirtualFile> findKTProcessor = new CommonProcessors.FindFirstProcessor<VirtualFile>() {
|
CommonProcessors.FindFirstProcessor<VirtualFile> findKTProcessor = new CommonProcessors.FindFirstProcessor<VirtualFile>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import org.jetbrains.jet.lang.psi.JetFile;
|
|||||||
import org.jetbrains.jet.plugin.versions.KotlinRuntimeLibraryUtil;
|
import org.jetbrains.jet.plugin.versions.KotlinRuntimeLibraryUtil;
|
||||||
import org.jetbrains.k2js.config.EcmaVersion;
|
import org.jetbrains.k2js.config.EcmaVersion;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ public class KotlinFrameworkDetector {
|
|||||||
ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(new Processor<Library>() {
|
ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(new Processor<Library>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean process(Library library) {
|
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);
|
jsLibrary.set(library);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user