Wraps syncPublisher() call in KotlinCompilerSettings in a dispose check
Fix ConfigureKotlinTest
This commit is contained in:
+3
-7
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.compiler.configuration
|
package org.jetbrains.kotlin.idea.compiler.configuration
|
||||||
|
|
||||||
import com.intellij.openapi.application.ApplicationManager
|
|
||||||
import com.intellij.openapi.components.PersistentStateComponent
|
import com.intellij.openapi.components.PersistentStateComponent
|
||||||
import com.intellij.openapi.components.StoragePathMacros.PROJECT_CONFIG_DIR
|
import com.intellij.openapi.components.StoragePathMacros.PROJECT_CONFIG_DIR
|
||||||
|
import com.intellij.openapi.progress.util.BackgroundTaskUtil
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.util.ReflectionUtil
|
import com.intellij.util.ReflectionUtil
|
||||||
import com.intellij.util.messages.Topic
|
import com.intellij.util.messages.Topic
|
||||||
@@ -42,9 +42,7 @@ abstract class BaseKotlinCompilerSettings<T : Freezable> protected constructor(p
|
|||||||
validateNewSettings(value)
|
validateNewSettings(value)
|
||||||
_settings = value
|
_settings = value
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
BackgroundTaskUtil.syncPublisher(project, KotlinCompilerSettingsListener.TOPIC).settingsChanged(value)
|
||||||
project.messageBus.syncPublisher(KotlinCompilerSettingsListener.TOPIC).settingsChanged(value)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun update(changer: T.() -> Unit) {
|
fun update(changer: T.() -> Unit) {
|
||||||
@@ -78,9 +76,7 @@ abstract class BaseKotlinCompilerSettings<T : Freezable> protected constructor(p
|
|||||||
XmlSerializer.deserializeInto(this, state)
|
XmlSerializer.deserializeInto(this, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
BackgroundTaskUtil.syncPublisher(project, KotlinCompilerSettingsListener.TOPIC).settingsChanged(settings)
|
||||||
project.messageBus.syncPublisher(KotlinCompilerSettingsListener.TOPIC).settingsChanged(settings)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun clone(): Any = super.clone()
|
public override fun clone(): Any = super.clone()
|
||||||
|
|||||||
+2
-6
@@ -40,9 +40,7 @@ abstract class BaseKotlinCompilerSettings<T : Freezable> protected constructor(p
|
|||||||
validateNewSettings(value)
|
validateNewSettings(value)
|
||||||
_settings = value
|
_settings = value
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
BackgroundTaskUtil.syncPublisher(project, KotlinCompilerSettingsListener.TOPIC).settingsChanged(value)
|
||||||
project.messageBus.syncPublisher(KotlinCompilerSettingsListener.TOPIC).settingsChanged(value)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun update(changer: T.() -> Unit) {
|
fun update(changer: T.() -> Unit) {
|
||||||
@@ -76,9 +74,7 @@ abstract class BaseKotlinCompilerSettings<T : Freezable> protected constructor(p
|
|||||||
XmlSerializer.deserializeInto(this, state)
|
XmlSerializer.deserializeInto(this, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
BackgroundTaskUtil.syncPublisher(project, KotlinCompilerSettingsListener.TOPIC).settingsChanged(settings)
|
||||||
project.messageBus.syncPublisher(KotlinCompilerSettingsListener.TOPIC).settingsChanged(settings)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun clone(): Any = super.clone()
|
public override fun clone(): Any = super.clone()
|
||||||
|
|||||||
Reference in New Issue
Block a user