CreateExpect: add actual modifier to original class if needed
This commit is contained in:
@@ -159,10 +159,8 @@ class CreateExpectedClassFix(
|
|||||||
} else
|
} else
|
||||||
selectedElements
|
selectedElements
|
||||||
|
|
||||||
if (originalElements.isNotEmpty()) {
|
project.executeWriteCommand("Repair actual members") {
|
||||||
project.executeWriteCommand("Repair actual members") {
|
repairActualModifiers(originalElements + klass, resultDeclarations.toSet())
|
||||||
repairActualModifiers(originalElements, resultDeclarations.toSet())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generateClassOrObject(project, true, element, checker, listOfNotNull(outerExpectedClass))
|
generateClassOrObject(project, true, element, checker, listOfNotNull(outerExpectedClass))
|
||||||
@@ -271,7 +269,7 @@ private fun repairActualModifiers(
|
|||||||
originalElements: Collection<KtNamedDeclaration>,
|
originalElements: Collection<KtNamedDeclaration>,
|
||||||
selectedElements: Collection<KtNamedDeclaration>
|
selectedElements: Collection<KtNamedDeclaration>
|
||||||
) {
|
) {
|
||||||
if (originalElements == selectedElements)
|
if (originalElements.size == selectedElements.size)
|
||||||
for (original in originalElements) {
|
for (original in originalElements) {
|
||||||
original.makeActualWithParents()
|
original.makeActualWithParents()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user