Fix main-kts jsr223 direct bindings processing
Before the jsr context was configured only when a dependency or import annotation is encountered, so direct properties mapping didn't work without using any of the annotations. (It was implemented like this as a workaround due to the problem with handlers composability, that was fixed some time ago.)
This commit is contained in:
@@ -41,6 +41,11 @@ object MainKtsScriptDefinition : ScriptCompilationConfiguration(
|
||||
}
|
||||
refineConfiguration {
|
||||
onAnnotations(DependsOn::class, Repository::class, Import::class, handler = MainKtsConfigurator())
|
||||
beforeCompiling { context ->
|
||||
configureProvidedPropertiesFromJsr223Context(
|
||||
ScriptConfigurationRefinementContext(context.script, context.compilationConfiguration, context.collectedData)
|
||||
)
|
||||
}
|
||||
}
|
||||
ide {
|
||||
acceptedLocations(ScriptAcceptedLocation.Everywhere)
|
||||
@@ -61,11 +66,7 @@ class MainKtsConfigurator : RefineScriptCompilationConfigurationHandler {
|
||||
private val resolver = FilesAndIvyResolver()
|
||||
|
||||
override operator fun invoke(context: ScriptConfigurationRefinementContext): ResultWithDiagnostics<ScriptCompilationConfiguration> =
|
||||
processAnnotations(context).onSuccess { updatedConfiguration ->
|
||||
configureProvidedPropertiesFromJsr223Context(
|
||||
ScriptConfigurationRefinementContext(context.script, updatedConfiguration, context.collectedData)
|
||||
)
|
||||
}
|
||||
processAnnotations(context)
|
||||
|
||||
fun processAnnotations(context: ScriptConfigurationRefinementContext): ResultWithDiagnostics<ScriptCompilationConfiguration> {
|
||||
val diagnostics = arrayListOf<ScriptDiagnostic>()
|
||||
|
||||
Reference in New Issue
Block a user