File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,11 @@ object CodeGenerationController {
274
274
reformat(model, SmartPointerManager .getInstance(model.project).createSmartPsiElementPointer(utUtilsFile), utUtilsClass)
275
275
})
276
276
277
- val utUtilsDocument = PsiDocumentManager
278
- .getInstance(model.project)
279
- .getDocument(utUtilsFile) ? : error(" Failed to get a Document for UtUtils file" )
277
+ val utUtilsDocument = runReadAction {
278
+ PsiDocumentManager
279
+ .getInstance(model.project)
280
+ .getDocument(utUtilsFile) ? : error(" Failed to get a Document for UtUtils file" )
281
+ }
280
282
281
283
unblockDocument(model.project, utUtilsDocument)
282
284
}
@@ -286,10 +288,12 @@ object CodeGenerationController {
286
288
utilClassKind : UtilClassKind ,
287
289
model : GenerateTestsModel
288
290
): PsiFile {
289
- val utilsClassDocument = PsiDocumentManager
290
- .getInstance(model.project)
291
- .getDocument(existingUtilClass)
292
- ? : error(" Failed to get Document for UtUtils class PsiFile: ${existingUtilClass.name} " )
291
+ val utilsClassDocument = runReadAction {
292
+ PsiDocumentManager
293
+ .getInstance(model.project)
294
+ .getDocument(existingUtilClass)
295
+ ? : error(" Failed to get Document for UtUtils class PsiFile: ${existingUtilClass.name} " )
296
+ }
293
297
294
298
val utUtilsText = utilClassKind.getUtilClassText(model.codegenLanguage)
295
299
You can’t perform that action at this time.
0 commit comments