in robot-server-core/src/main/kotlin/com/intellij/remoterobot/services/IdeRobot.kt [180:195]
fun doAction(componentId: String, actionContainer: ObjectContainer): Result<Unit> {
val componentContext = componentContextCache[componentId]
?: throw IllegalStateException("Unknown component id $componentId")
return getResult(componentContext) { ctx ->
if (actionContainer.runInEdt) {
runInEdtWithWIL {
val action =
lambdaLoader.getFunction(actionContainer) as ComponentContext.() -> Unit
ctx.action()
}
} else {
val action = lambdaLoader.getFunction(actionContainer) as ComponentContext.() -> Unit
ctx.action()
}
}
}