From 2c0dc32939fe97ae0ba120899f91a314b3904a14 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 13 Apr 2018 18:11:34 +0200 Subject: [PATCH] quick solution of "incorrect before run list is set on template RC modification" --- .../src/com/intellij/execution/impl/RunManagerImpl.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt index 0daf8d806268..a420da42879b 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt @@ -924,14 +924,20 @@ open class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persi } else { val templateConfiguration = getConfigurationTemplate(configuration.factory).configuration - val templateTasks = if (templateConfiguration === configuration) { + val isTemplate = templateConfiguration === configuration + val templateTasks = if (isTemplate) { getHardcodedBeforeRunTasks(configuration) } else { getTemplateBeforeRunTasks(templateConfiguration) } - if (templateConfiguration === configuration) { + if (isTemplate) { + if (tasks == templateTasks) { + // nothing is changed + return + } + // we must update all existing configuration tasks to ensure that effective tasks (own + template) are the same as before template configuration change // see testTemplates test lock.read {