generateUtil: fix PIEAE
#EA-142347 Fixed
This commit is contained in:
@@ -222,7 +222,7 @@ fun <T : KtDeclaration> insertMembersAfter(
|
|||||||
getAnchor: (KtDeclaration) -> PsiElement? = { null }
|
getAnchor: (KtDeclaration) -> PsiElement? = { null }
|
||||||
): List<T> {
|
): List<T> {
|
||||||
members.ifEmpty { return emptyList() }
|
members.ifEmpty { return emptyList() }
|
||||||
|
val project = classOrObject.project
|
||||||
return runWriteAction {
|
return runWriteAction {
|
||||||
val insertedMembers = SmartList<T>()
|
val insertedMembers = SmartList<T>()
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ fun <T : KtDeclaration> insertMembersAfter(
|
|||||||
moveCaretIntoGeneratedElement(editor, firstElement)
|
moveCaretIntoGeneratedElement(editor, firstElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
val codeStyleManager = CodeStyleManager.getInstance(firstElement.project)
|
val codeStyleManager = CodeStyleManager.getInstance(project)
|
||||||
resultMembers.forEach { codeStyleManager.reformat(it) }
|
resultMembers.forEach { codeStyleManager.reformat(it) }
|
||||||
|
|
||||||
resultMembers.toList()
|
resultMembers.toList()
|
||||||
|
|||||||
Reference in New Issue
Block a user