File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,8 @@ object CodeGenerationController {
264264
265265 val classUnderTest = testSets.first().method.clazz
266266
267- val params = findMethodParams(classUnderTest, selectedMethods)
267+ val params = DumbService .getInstance(model.project)
268+ .runReadActionInSmartMode(Computable { findMethodParams(classUnderTest, selectedMethods) })
268269
269270 val codeGenerator = CodeGenerator (
270271 classUnderTest = classUnderTest.java,
Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ import com.intellij.openapi.components.service
1212import com.intellij.openapi.module.Module
1313import com.intellij.openapi.progress.ProgressIndicator
1414import com.intellij.openapi.progress.Task
15+ import com.intellij.openapi.project.DumbService
1516import com.intellij.openapi.project.Project
1617import com.intellij.openapi.roots.OrderEnumerator
1718import com.intellij.openapi.ui.Messages
19+ import com.intellij.openapi.util.Computable
1820import com.intellij.openapi.util.text.StringUtil
1921import com.intellij.psi.PsiClass
2022import com.intellij.psi.SyntheticElement
@@ -150,7 +152,9 @@ object UtTestsDialogProcessor {
150152 .filterWhen(UtSettings .skipTestGenerationForSyntheticMethods) {
151153 it.member !is SyntheticElement
152154 }
153- findMethodsInClassMatchingSelected(clazz, srcMethods)
155+ DumbService .getInstance(project).runReadActionInSmartMode(Computable {
156+ findMethodsInClassMatchingSelected(clazz, srcMethods)
157+ })
154158 }.executeSynchronously()
155159
156160 val className = srcClass.name
Original file line number Diff line number Diff line change 11package org.utbot.intellij.plugin.util
22
3+ import com.intellij.openapi.project.DumbService
4+ import com.intellij.openapi.project.Project
5+ import com.intellij.openapi.util.Computable
36import com.intellij.psi.PsiMethod
47import com.intellij.refactoring.util.classMembers.MemberInfo
58import kotlin.reflect.KFunction
69import kotlin.reflect.KParameter
710import kotlin.reflect.jvm.javaType
811
912fun MemberInfo.signature (): Signature =
10- (this .member as PsiMethod ).signature()
13+ (this .member as PsiMethod ).signature()
1114
12- fun PsiMethod.signature () =
15+ private fun PsiMethod.signature () =
1316 Signature (this .name, this .parameterList.parameters.map {
1417 it.type.canonicalText
1518 .replace(" ..." , " []" ) // for PsiEllipsisType
You can’t perform that action at this time.
0 commit comments