File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
core/src/main/kotlin/cc/unitmesh/devti/prompting Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,16 @@ import com.intellij.openapi.project.Project
14
14
import com.intellij.psi.PsiDocumentManager
15
15
import cc.unitmesh.devti.intentions.action.getElementToAction
16
16
import kotlinx.coroutines.runBlocking
17
+ import com.intellij.openapi.application.runReadAction
17
18
18
19
abstract class SimpleDevinPrompter {
19
20
abstract val templateRender: TemplateRender
20
21
abstract val template: String
21
22
22
23
suspend fun prompting (project : Project , userInput : String , editor : Editor ? ): String {
23
- val variableCompile = VariableTemplateCompiler .create(project, editor)
24
+ val variableCompile = runReadAction {
25
+ VariableTemplateCompiler .create(project, editor)
26
+ }
24
27
if (variableCompile == null ) {
25
28
val frameworkContext = collectFrameworkContext(editor, project)
26
29
templateRender.addVariable(" input" , userInput)
You can’t perform that action at this time.
0 commit comments