From b3a84ba081d14306fa2301c31fff2706ef2ab319 Mon Sep 17 00:00:00 2001 From: Natalia Selezneva Date: Fri, 26 Jun 2020 15:47:59 +0300 Subject: [PATCH] Fix warning in ScriptConfigurationHighlightingTest In case of exception from dependencies resolver we do not threat the configurations as up-to-date, so the reloading process will be started during test despite updateScriptDependenciesSynchronously called at startup. This will lead to the warning from checkHighlighting because if script reports are different we rehighlight the script. Note that test won't fail. --- .../highlighting/throwingResolver/template/template.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/idea/testData/script/definition/highlighting/throwingResolver/template/template.kt b/idea/testData/script/definition/highlighting/throwingResolver/template/template.kt index e4ccca4005b..217493c4ee7 100644 --- a/idea/testData/script/definition/highlighting/throwingResolver/template/template.kt +++ b/idea/testData/script/definition/highlighting/throwingResolver/template/template.kt @@ -8,11 +8,14 @@ import kotlin.script.experimental.location.* class TestDependenciesResolver : DependenciesResolver { override fun resolve( - scriptContents: ScriptContents, - environment: Environment + scriptContents: ScriptContents, + environment: Environment ): DependenciesResolver.ResolveResult { - error("Exception from resolver") + throw ex } + + // this is needed for equality of script reports to avoid highlighting restart during test + private val ex = IllegalStateException("Exception from resolver") } @ScriptExpectedLocations([ScriptExpectedLocation.Everywhere])