use more deterministic check to determine that "Configure Kotlin in project" notification should be displayed

#KT-10898 Fixed
This commit is contained in:
Dmitry Jemerov
2016-02-03 12:33:24 +01:00
parent 394221fefb
commit e227f6fc74
5 changed files with 9 additions and 7 deletions
@@ -56,7 +56,7 @@ public class ProjectStructureUtil {
return module != null && isJsKotlinModule(module);
}
public static boolean isJavaKotlinModule(@NotNull Module module) {
public static boolean hasKotlinRuntimeInScope(@NotNull Module module) {
GlobalSearchScope scope = module.getModuleWithDependenciesAndLibrariesScope(
hasKotlinFilesOnlyInTests(module));
return KotlinRuntimeLibraryCoreUtil.getKotlinRuntimeMarkerClass(module.getProject(), scope) != null;
@@ -89,7 +89,7 @@ public class ProjectStructureUtil {
boolean hasJvmKotlinModules = false;
for (Module module : ModuleManager.getInstance(project).getModules()) {
if (isJavaKotlinModule(module)) {
if (hasKotlinRuntimeInScope(module)) {
hasJvmKotlinModules = true;
break;
}
@@ -117,7 +117,7 @@ public class ProjectStructureUtil {
ModuleUtilCore.collectModulesDependsOn(module, dependentModules);
for (Module module : dependentModules) {
if (isJavaKotlinModule(module)) {
if (hasKotlinRuntimeInScope(module)) {
usedInKotlinModule = true;
break;
}