File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
utbot-intellij-js/src/main/kotlin/org/utbot/intellij/plugin/language/js Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -186,13 +186,16 @@ object JsDialogProcessor {
186186 val generatedCode = testGenerator.run ()
187187 invokeLater {
188188 runWriteAction {
189- val testPsiFile = testDir.findFile(testFileName) ? : PsiFileFactory .getInstance(project)
190- .createFileFromText(testFileName, JsLanguageAssistant .jsLanguage, generatedCode)
189+ val testPsiFile = testDir.findFile(testFileName) ? : run {
190+ val temp = PsiFileFactory .getInstance(project)
191+ .createFileFromText(testFileName, JsLanguageAssistant .jsLanguage, generatedCode)
192+ testDir.add(temp)
193+ testDir.findFile(testFileName)!!
194+ }
191195 val testFileEditor = CodeInsightUtil .positionCursor(project, testPsiFile, testPsiFile)
192196 unblockDocument(project, testFileEditor.document)
193197 testFileEditor.document.setText(generatedCode)
194198 unblockDocument(project, testFileEditor.document)
195- testDir.findFile(testFileName) ? : testDir.add(testPsiFile)
196199 }
197200 }
198201 }
You can’t perform that action at this time.
0 commit comments