Scripting: avoid creating multiple PSIs for every imported script

#KT-53009 fixed
#KT-42810 should be possible now too, but more testing is needed
#KT-42101 can also be addressed now, but first the serialization
 of the imported scripts property should be solved
This commit is contained in:
Ilya Chernikov
2022-07-20 19:42:53 +02:00
committed by teamcity
parent 9bc057afb2
commit ceea563d63
5 changed files with 90 additions and 42 deletions
@@ -373,7 +373,7 @@ class ScriptingHostTest : TestCase() {
}
val res = BasicJvmScriptingHost().eval(script.toScriptSource(), compilationConfiguration, null)
assertTrue(res is ResultWithDiagnostics.Failure)
val report = res.reports.find { it.message.startsWith("Source file or directory not found") }
val report = res.reports.find { it.message.startsWith("Imported source file not found") }
assertNotNull(report)
assertEquals("script.kts", report?.sourcePath)
}