Scripting: restore reports for applied configuration in case of previous error

This commit is contained in:
Sergey Rostov
2019-11-06 15:00:13 +03:00
committed by Natalia Selezneva
parent 96b4ceb067
commit 05e8acffa7
@@ -232,7 +232,8 @@ internal class DefaultScriptConfigurationManager(project: Project) :
if (newConfiguration == null) { if (newConfiguration == null) {
saveReports(file, newResult.reports) saveReports(file, newResult.reports)
} else { } else {
val oldConfiguration = getAppliedConfiguration(file)?.configuration val old = getCachedConfigurationState(file)
val oldConfiguration = old?.applied?.configuration
if (oldConfiguration == newConfiguration) { if (oldConfiguration == newConfiguration) {
saveReports(file, newResult.reports) saveReports(file, newResult.reports)
file.removeScriptDependenciesNotificationPanel(project) file.removeScriptDependenciesNotificationPanel(project)
@@ -252,6 +253,12 @@ internal class DefaultScriptConfigurationManager(project: Project) :
debug(file) { debug(file) {
"configuration changed, notification is shown: old = $oldConfiguration, new = $newConfiguration" "configuration changed, notification is shown: old = $oldConfiguration, new = $newConfiguration"
} }
// restore reports for applied configuration in case of previous error
old?.applied?.reports?.let {
saveReports(file, it)
}
file.addScriptDependenciesNotificationPanel( file.addScriptDependenciesNotificationPanel(
newConfiguration, project, newConfiguration, project,
onClick = { onClick = {