generateUtil: fix PIEAE

#EA-142347 Fixed
This commit is contained in:
Dmitry Gridin
2019-10-10 20:35:57 +07:00
parent 1a8796c79a
commit 2eb035aff2
@@ -222,7 +222,7 @@ fun <T : KtDeclaration> insertMembersAfter(
getAnchor: (KtDeclaration) -> PsiElement? = { null }
): List<T> {
members.ifEmpty { return emptyList() }
val project = classOrObject.project
return runWriteAction {
val insertedMembers = SmartList<T>()
@@ -269,7 +269,7 @@ fun <T : KtDeclaration> insertMembersAfter(
moveCaretIntoGeneratedElement(editor, firstElement)
}
val codeStyleManager = CodeStyleManager.getInstance(firstElement.project)
val codeStyleManager = CodeStyleManager.getInstance(project)
resultMembers.forEach { codeStyleManager.reformat(it) }
resultMembers.toList()