diff --git a/idea/src/org/jetbrains/kotlin/idea/configuration/outdatedBundledCompilerNotification.kt b/idea/src/org/jetbrains/kotlin/idea/configuration/outdatedBundledCompilerNotification.kt index adc6e4f4d96..ad0d05d1e9d 100644 --- a/idea/src/org/jetbrains/kotlin/idea/configuration/outdatedBundledCompilerNotification.kt +++ b/idea/src/org/jetbrains/kotlin/idea/configuration/outdatedBundledCompilerNotification.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.idea.KotlinPluginUtil import org.jetbrains.kotlin.idea.actions.ConfigurePluginUpdatesAction import org.jetbrains.kotlin.idea.project.languageVersionSettings import org.jetbrains.kotlin.psi.UserDataProperty +import java.util.concurrent.ConcurrentHashMap import javax.swing.event.HyperlinkEvent var Module.externalCompilerVersion: String? by UserDataProperty(Key.create("EXTERNAL_COMPILER_VERSION")) @@ -71,6 +72,8 @@ fun notifyOutdatedBundledCompilerIfNecessary(project: Project) { ) } +private var alreadyNotified = ConcurrentHashMap() + fun createOutdatedBundledCompilerMessage(project: Project, bundledCompilerVersion: String = KotlinCompilerVersion.VERSION): String? { val bundledCompilerMajorVersion = MajorVersion.create(bundledCompilerVersion) ?: return null @@ -98,6 +101,14 @@ fun createOutdatedBundledCompilerMessage(project: Project, bundledCompilerVersio return null } + val lastProjectNotified = alreadyNotified[project.name] + if (lastProjectNotified == maxCompilerInfo.externalCompilerVersion) { + if (!ApplicationManager.getApplication().isUnitTestMode) { + return null + } + } + alreadyNotified[project.name] = maxCompilerInfo.externalCompilerVersion + val selectedNewerModulesInfos = selectedModulesForPopup(project, maxCompilerInfo, newerModuleCompilerInfos) if (selectedNewerModulesInfos.isEmpty()) { return null