Create Test Intention: Fix RuntimeException on attempt to convert generated test class to Kotlin

#KT-12285 Fixed
 #EA-82281 Fixed
This commit is contained in:
Alexey Sedunov
2016-06-08 12:02:28 +03:00
parent 32c5ccdaad
commit 158037dd68
2 changed files with 5 additions and 0 deletions
@@ -180,6 +180,10 @@ class KotlinCreateTestIntention : SelfTargetingRangeIntention<KtNamedDeclaration
NavigationUtil.activateFileWithPsiElement(existingClass)
}
else {
with(PsiDocumentManager.getInstance(project)) {
getDocument(generatedFile)?.let { doPostponedOperationsAndUnblockDocument(it) }
}
JavaToKotlinAction.convertFiles(generatedFile.singletonList(), project, false).singleOrNull()
}
}