diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/dependencies/ScriptDependenciesLoader.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/dependencies/ScriptDependenciesLoader.kt index 16c372167f2..27b2dc9403c 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/dependencies/ScriptDependenciesLoader.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/dependencies/ScriptDependenciesLoader.kt @@ -70,9 +70,15 @@ abstract class ScriptDependenciesLoader( protected fun processResult(result: DependenciesResolver.ResolveResult) { loaders.remove(file) - val newDependencies = result.dependencies?.adjustByDefinition(scriptDef) ?: return + if (cache[file] == null) { + saveDependencies(result) + attachReports(result) + return + } + + val newDependencies = result.dependencies?.adjustByDefinition(scriptDef) if (cache[file] != newDependencies) { - if (shouldShowNotification() && cache[file] != null && !ApplicationManager.getApplication().isUnitTestMode) { + if (shouldShowNotification() && !ApplicationManager.getApplication().isUnitTestMode) { file.addScriptDependenciesNotificationPanel(result, project) { saveDependencies(it) attachReports(it)