Misc: Add "refactoring exit" message
This allows executing mandatory code at the end of particular refactoring. Also this fixes memory leak due to listener not being disposed #KT-17235 Fixed
This commit is contained in:
@@ -19,9 +19,9 @@ package org.jetbrains.kotlin.idea.intentions
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import org.jetbrains.kotlin.idea.refactoring.CompositeRefactoringRunner
|
||||
import org.jetbrains.kotlin.idea.refactoring.checkConflictsInteractively
|
||||
import org.jetbrains.kotlin.idea.refactoring.move.moveDeclarations.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.runRefactoringWithPostprocessing
|
||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
@@ -54,12 +54,10 @@ abstract class MoveMemberOutOfObjectIntention(text: String) : SelfTargetingRange
|
||||
KotlinMoveTargetForExistingElement(destination),
|
||||
MoveDeclarationsDelegate.NestedClass()
|
||||
)
|
||||
val refactoring = { MoveKotlinDeclarationsProcessor(moveDescriptor).run() }
|
||||
refactoring.runRefactoringWithPostprocessing(project, MoveKotlinDeclarationsProcessor.REFACTORING_ID) {
|
||||
runWriteAction {
|
||||
deleteClassOrObjectIfEmpty()
|
||||
}
|
||||
}
|
||||
object : CompositeRefactoringRunner(project, MoveKotlinDeclarationsProcessor.REFACTORING_ID) {
|
||||
override fun runRefactoring() = MoveKotlinDeclarationsProcessor(moveDescriptor).run()
|
||||
override fun onRefactoringDone() = runWriteAction { deleteClassOrObjectIfEmpty() }
|
||||
}.run()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.idea.core.CollectingNameValidator
|
||||
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
|
||||
import org.jetbrains.kotlin.idea.core.appendElement
|
||||
import org.jetbrains.kotlin.idea.core.getOrCreateBody
|
||||
import org.jetbrains.kotlin.idea.refactoring.runRefactoringWithPostprocessing
|
||||
import org.jetbrains.kotlin.idea.refactoring.CompositeRefactoringRunner
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.*
|
||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
@@ -112,12 +112,17 @@ object InitializePropertyQuickFixFactory : KotlinIntentionActionsFactory() {
|
||||
val contextElement = constructorDescriptor.source.getPsi() ?: return
|
||||
val constructorPointer = contextElement.createSmartPointer()
|
||||
val config = configureChangeSignature(element, propertyDescriptor)
|
||||
val changeSignature = { runChangeSignature(project, constructorDescriptor, config, contextElement, text) }
|
||||
changeSignature.runRefactoringWithPostprocessing(project, "refactoring.changeSignature") {
|
||||
val constructorOrClass = constructorPointer.element
|
||||
val constructor = constructorOrClass as? KtConstructor<*> ?: (constructorOrClass as? KtClass)?.primaryConstructor
|
||||
constructor?.getValueParameters()?.lastOrNull()?.replace(parameterToInsert)
|
||||
}
|
||||
object : CompositeRefactoringRunner(project, "refactoring.changeSignature") {
|
||||
override fun runRefactoring() {
|
||||
runChangeSignature(project, constructorDescriptor, config, contextElement, text)
|
||||
}
|
||||
|
||||
override fun onRefactoringDone() {
|
||||
val constructorOrClass = constructorPointer.element
|
||||
val constructor = constructorOrClass as? KtConstructor<*> ?: (constructorOrClass as? KtClass)?.primaryConstructor
|
||||
constructor?.getValueParameters()?.lastOrNull()?.replace(parameterToInsert)
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
finally {
|
||||
FinishMarkAction.finish(project, editor, startMarkAction)
|
||||
@@ -170,20 +175,26 @@ object InitializePropertyQuickFixFactory : KotlinIntentionActionsFactory() {
|
||||
val descriptor = descriptorsToProcess.next()
|
||||
val constructorPointer = descriptor.source.getPsi()?.createSmartPointer()
|
||||
val config = configureChangeSignature(propertyDescriptor)
|
||||
val changeSignature = { runChangeSignature(project, descriptor, config, element.containingClassOrObject!!, text) }
|
||||
val changeSignature = { }
|
||||
|
||||
changeSignature.runRefactoringWithPostprocessing(project, "refactoring.changeSignature") {
|
||||
val constructorOrClass = constructorPointer?.element
|
||||
val constructor = constructorOrClass as? KtConstructor<*> ?: (constructorOrClass as? KtClass)?.primaryConstructor
|
||||
if (constructor == null || !visitedElements.add(constructor)) return@runRefactoringWithPostprocessing
|
||||
constructor.getValueParameters().lastOrNull()?.let { newParam ->
|
||||
val psiFactory = KtPsiFactory(project)
|
||||
(constructor as? KtSecondaryConstructor)?.getOrCreateBody()?.appendElement(
|
||||
psiFactory.createExpression("this.${element.name} = ${newParam.name!!}")
|
||||
) ?: element.setInitializer(psiFactory.createExpression(newParam.name!!))
|
||||
object : CompositeRefactoringRunner(project, "refactoring.changeSignature") {
|
||||
override fun runRefactoring() {
|
||||
runChangeSignature(project, descriptor, config, element.containingClassOrObject!!, text)
|
||||
}
|
||||
processConstructors(project, propertyDescriptor, descriptorsToProcess)
|
||||
}
|
||||
|
||||
override fun onRefactoringDone() {
|
||||
val constructorOrClass = constructorPointer?.element
|
||||
val constructor = constructorOrClass as? KtConstructor<*> ?: (constructorOrClass as? KtClass)?.primaryConstructor
|
||||
if (constructor == null || !visitedElements.add(constructor)) return
|
||||
constructor.getValueParameters().lastOrNull()?.let { newParam ->
|
||||
val psiFactory = KtPsiFactory(project)
|
||||
(constructor as? KtSecondaryConstructor)?.getOrCreateBody()?.appendElement(
|
||||
psiFactory.createExpression("this.${element.name} = ${newParam.name!!}")
|
||||
) ?: element.setInitializer(psiFactory.createExpression(newParam.name!!))
|
||||
}
|
||||
processConstructors(project, propertyDescriptor, descriptorsToProcess)
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
|
||||
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
|
||||
|
||||
+11
-6
@@ -27,9 +27,9 @@ import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.Callab
|
||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.CallablePlacement
|
||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.PropertyInfo
|
||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.createBuilder
|
||||
import org.jetbrains.kotlin.idea.refactoring.CompositeRefactoringRunner
|
||||
import org.jetbrains.kotlin.idea.refactoring.canRefactor
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.runRefactoringWithPostprocessing
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
import org.jetbrains.kotlin.resolve.source.getPsi
|
||||
@@ -61,11 +61,16 @@ open class CreateParameterFromUsageFix<E : KtElement>(
|
||||
val onComplete = data.onComplete
|
||||
if (onComplete == null) {
|
||||
runChangeSignature(project)
|
||||
}
|
||||
else {
|
||||
{ runChangeSignature(project) }.runRefactoringWithPostprocessing(project, "refactoring.changeSignature") {
|
||||
onComplete(editor)
|
||||
}
|
||||
} else {
|
||||
object : CompositeRefactoringRunner(project, "refactoring.changeSignature") {
|
||||
override fun runRefactoring() {
|
||||
runChangeSignature(project)
|
||||
}
|
||||
|
||||
override fun onRefactoringDone() {
|
||||
onComplete(editor)
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.refactoring
|
||||
|
||||
import com.intellij.util.messages.Topic
|
||||
|
||||
interface KotlinRefactoringEventListener {
|
||||
companion object {
|
||||
val EVENT_TOPIC = Topic.create("KOTLIN_REFACTORING_EVENT_TOPIC", KotlinRefactoringEventListener::class.java)
|
||||
}
|
||||
|
||||
fun onRefactoringExit(refactoringId: String)
|
||||
}
|
||||
+6
-1
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
|
||||
import org.jetbrains.kotlin.idea.core.getDeepestSuperDeclarations
|
||||
import org.jetbrains.kotlin.idea.refactoring.CallableRefactoring
|
||||
import org.jetbrains.kotlin.idea.refactoring.broadcastRefactoringExit
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.ui.KotlinChangePropertySignatureDialog
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.ui.KotlinChangeSignatureDialog
|
||||
import org.jetbrains.kotlin.idea.refactoring.createJavaMethod
|
||||
@@ -60,7 +61,11 @@ fun runChangeSignature(project: Project,
|
||||
configuration: KotlinChangeSignatureConfiguration,
|
||||
defaultValueContext: PsiElement,
|
||||
commandName: String? = null): Boolean {
|
||||
return KotlinChangeSignature(project, callableDescriptor, configuration, defaultValueContext, commandName).run()
|
||||
val result = KotlinChangeSignature(project, callableDescriptor, configuration, defaultValueContext, commandName).run()
|
||||
if (!result) {
|
||||
broadcastRefactoringExit(project, "refactoring.changeSignature")
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
class KotlinChangeSignature(
|
||||
|
||||
+9
@@ -30,6 +30,7 @@ import com.intellij.refactoring.rename.UnresolvableCollisionUsageInfo
|
||||
import com.intellij.usageView.UsageInfo
|
||||
import com.intellij.usageView.UsageViewDescriptor
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import org.jetbrains.kotlin.idea.refactoring.broadcastRefactoringExit
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.usages.KotlinFunctionCallUsage
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.usages.KotlinImplicitReceiverUsage
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.usages.KotlinUsageInfo
|
||||
@@ -121,4 +122,12 @@ class KotlinChangeSignatureProcessor(
|
||||
changeInfo.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
override fun doRun() {
|
||||
try {
|
||||
super.doRun()
|
||||
} finally {
|
||||
broadcastRefactoringExit(myProject, refactoringId!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -29,7 +29,6 @@ import org.jetbrains.kotlin.idea.refactoring.introduce.extractFunction.ui.Extrac
|
||||
import org.jetbrains.kotlin.idea.refactoring.introduce.extractFunction.ui.KotlinExtractFunctionDialog
|
||||
import org.jetbrains.kotlin.idea.refactoring.introduce.extractionEngine.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.isMultiLine
|
||||
import org.jetbrains.kotlin.idea.refactoring.runRefactoringWithPostprocessing
|
||||
import org.jetbrains.kotlin.idea.refactoring.validateElement
|
||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.kotlin.idea.util.application.executeCommand
|
||||
@@ -313,10 +312,9 @@ class KotlinIntroduceParameterDialog private constructor(
|
||||
occurrenceReplacer = newReplacer
|
||||
)
|
||||
|
||||
val introduceParameter = { helper.configure(descriptorToRefactor).performRefactoring() }
|
||||
introduceParameter.runRefactoringWithPostprocessing(myProject, INTRODUCE_PARAMETER_REFACTORING_ID) {
|
||||
FinishMarkAction.finish(myProject, editor, startMarkAction)
|
||||
}
|
||||
helper.configure(descriptorToRefactor).performRefactoring(
|
||||
onExit = { FinishMarkAction.finish(myProject, editor, startMarkAction) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-10
@@ -40,12 +40,12 @@ import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.unsafeResolveToDescriptor
|
||||
import org.jetbrains.kotlin.idea.codeInsight.CodeInsightUtils
|
||||
import org.jetbrains.kotlin.idea.core.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.CompositeRefactoringRunner
|
||||
import org.jetbrains.kotlin.idea.refactoring.KotlinRefactoringBundle
|
||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.introduce.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.introduce.extractionEngine.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.removeTemplateEntryBracesIfPossible
|
||||
import org.jetbrains.kotlin.idea.refactoring.runRefactoringWithPostprocessing
|
||||
import org.jetbrains.kotlin.idea.refactoring.showWithTransaction
|
||||
import org.jetbrains.kotlin.idea.references.mainReference
|
||||
import org.jetbrains.kotlin.idea.runSynchronouslyWithProgress
|
||||
@@ -132,7 +132,7 @@ fun getParametersToRemove(
|
||||
.map { it.key }
|
||||
}
|
||||
|
||||
fun IntroduceParameterDescriptor.performRefactoring() {
|
||||
fun IntroduceParameterDescriptor.performRefactoring(onExit: (() -> Unit)? = null) {
|
||||
val config = object : KotlinChangeSignatureConfiguration {
|
||||
override fun configure(originalDescriptor: KotlinMethodDescriptor): KotlinMethodDescriptor {
|
||||
return originalDescriptor.modify { methodDescriptor ->
|
||||
@@ -164,18 +164,19 @@ fun IntroduceParameterDescriptor.performRefactoring() {
|
||||
}
|
||||
|
||||
val project = callable.project
|
||||
val changeSignature = { runChangeSignature(project, callableDescriptor, config, callable, INTRODUCE_PARAMETER) }
|
||||
object : CompositeRefactoringRunner(project, "refactoring.changeSignature") {
|
||||
override fun runRefactoring() {
|
||||
runChangeSignature(project, callableDescriptor, config, callable, INTRODUCE_PARAMETER)
|
||||
}
|
||||
|
||||
changeSignature.runRefactoringWithPostprocessing(project, "refactoring.changeSignature") {
|
||||
try {
|
||||
override fun onRefactoringDone() {
|
||||
occurrencesToReplace.forEach { occurrenceReplacer(it) }
|
||||
}
|
||||
finally {
|
||||
project.messageBus
|
||||
.syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC)
|
||||
.refactoringDone(INTRODUCE_PARAMETER_REFACTORING_ID, null)
|
||||
|
||||
override fun onExit() {
|
||||
onExit?.invoke()
|
||||
}
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
|
||||
fun selectNewParameterContext(
|
||||
|
||||
@@ -652,38 +652,60 @@ fun PsiMember.j2k(): KtNamedDeclaration? {
|
||||
return KtPsiFactory(project).createDeclaration(text)
|
||||
}
|
||||
|
||||
fun (() -> Any).runRefactoringWithPostprocessing(
|
||||
project: Project,
|
||||
targetRefactoringId: String,
|
||||
finishAction: () -> Unit
|
||||
internal fun broadcastRefactoringExit(project: Project, refactoringId: String) {
|
||||
project.messageBus.syncPublisher(KotlinRefactoringEventListener.EVENT_TOPIC).onRefactoringExit(refactoringId)
|
||||
}
|
||||
|
||||
// IMPORTANT: Target refactoring must support KotlinRefactoringEventListener
|
||||
internal abstract class CompositeRefactoringRunner(
|
||||
val project: Project,
|
||||
val refactoringId: String
|
||||
) {
|
||||
val connection = project.messageBus.connect()
|
||||
connection.subscribe(RefactoringEventListener.REFACTORING_EVENT_TOPIC,
|
||||
object : RefactoringEventListener {
|
||||
override fun undoRefactoring(refactoringId: String) {
|
||||
protected abstract fun runRefactoring()
|
||||
|
||||
}
|
||||
protected open fun onRefactoringDone() {}
|
||||
protected open fun onExit() {}
|
||||
|
||||
override fun refactoringStarted(refactoringId: String, beforeData: RefactoringEventData?) {
|
||||
fun run() {
|
||||
val connection = project.messageBus.connect()
|
||||
connection.subscribe(
|
||||
RefactoringEventListener.REFACTORING_EVENT_TOPIC,
|
||||
object : RefactoringEventListener {
|
||||
override fun undoRefactoring(refactoringId: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun conflictsDetected(refactoringId: String, conflictsData: RefactoringEventData) {
|
||||
override fun refactoringStarted(refactoringId: String, beforeData: RefactoringEventData?) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun refactoringDone(refactoringId: String, afterData: RefactoringEventData?) {
|
||||
if (refactoringId == targetRefactoringId) {
|
||||
try {
|
||||
finishAction()
|
||||
}
|
||||
finally {
|
||||
connection.disconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
this()
|
||||
override fun conflictsDetected(refactoringId: String, conflictsData: RefactoringEventData) {
|
||||
|
||||
}
|
||||
|
||||
override fun refactoringDone(refactoringId: String, afterData: RefactoringEventData?) {
|
||||
if (refactoringId == this@CompositeRefactoringRunner.refactoringId) {
|
||||
onRefactoringDone()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
connection.subscribe(
|
||||
KotlinRefactoringEventListener.EVENT_TOPIC,
|
||||
object : KotlinRefactoringEventListener {
|
||||
override fun onRefactoringExit(refactoringId: String) {
|
||||
if (refactoringId == this@CompositeRefactoringRunner.refactoringId) {
|
||||
try {
|
||||
onExit()
|
||||
} finally {
|
||||
connection.disconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
runRefactoring()
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(ConfigurationException::class) fun KtElement?.validateElement(errorMessage: String) {
|
||||
|
||||
@@ -654,38 +654,60 @@ fun PsiMember.j2k(): KtNamedDeclaration? {
|
||||
return KtPsiFactory(project).createDeclaration(text)
|
||||
}
|
||||
|
||||
fun (() -> Any).runRefactoringWithPostprocessing(
|
||||
project: Project,
|
||||
targetRefactoringId: String,
|
||||
finishAction: () -> Unit
|
||||
internal fun broadcastRefactoringExit(project: Project, refactoringId: String) {
|
||||
project.messageBus.syncPublisher(KotlinRefactoringEventListener.EVENT_TOPIC).onRefactoringExit(refactoringId)
|
||||
}
|
||||
|
||||
// IMPORTANT: Target refactoring must support KotlinRefactoringEventListener
|
||||
internal abstract class CompositeRefactoringRunner(
|
||||
val project: Project,
|
||||
val refactoringId: String
|
||||
) {
|
||||
val connection = project.messageBus.connect()
|
||||
connection.subscribe(RefactoringEventListener.REFACTORING_EVENT_TOPIC,
|
||||
object : RefactoringEventListener {
|
||||
override fun undoRefactoring(refactoringId: String) {
|
||||
protected abstract fun runRefactoring()
|
||||
|
||||
}
|
||||
protected open fun onRefactoringDone() {}
|
||||
protected open fun onExit() {}
|
||||
|
||||
override fun refactoringStarted(refactoringId: String, beforeData: RefactoringEventData?) {
|
||||
fun run() {
|
||||
val connection = project.messageBus.connect()
|
||||
connection.subscribe(
|
||||
RefactoringEventListener.REFACTORING_EVENT_TOPIC,
|
||||
object : RefactoringEventListener {
|
||||
override fun undoRefactoring(refactoringId: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun conflictsDetected(refactoringId: String, conflictsData: RefactoringEventData) {
|
||||
override fun refactoringStarted(refactoringId: String, beforeData: RefactoringEventData?) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun refactoringDone(refactoringId: String, afterData: RefactoringEventData?) {
|
||||
if (refactoringId == targetRefactoringId) {
|
||||
try {
|
||||
finishAction()
|
||||
}
|
||||
finally {
|
||||
connection.disconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
this()
|
||||
override fun conflictsDetected(refactoringId: String, conflictsData: RefactoringEventData) {
|
||||
|
||||
}
|
||||
|
||||
override fun refactoringDone(refactoringId: String, afterData: RefactoringEventData?) {
|
||||
if (refactoringId == this@CompositeRefactoringRunner.refactoringId) {
|
||||
onRefactoringDone()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
connection.subscribe(
|
||||
KotlinRefactoringEventListener.EVENT_TOPIC,
|
||||
object : KotlinRefactoringEventListener {
|
||||
override fun onRefactoringExit(refactoringId: String) {
|
||||
if (refactoringId == this@CompositeRefactoringRunner.refactoringId) {
|
||||
try {
|
||||
onExit()
|
||||
} finally {
|
||||
connection.disconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
runRefactoring()
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(ConfigurationException::class) fun KtElement?.validateElement(errorMessage: String) {
|
||||
|
||||
+9
@@ -50,6 +50,7 @@ import org.jetbrains.kotlin.asJava.toLightElements
|
||||
import org.jetbrains.kotlin.idea.codeInsight.shorten.addToBeShortenedDescendantsToWaitingSet
|
||||
import org.jetbrains.kotlin.idea.core.deleteSingle
|
||||
import org.jetbrains.kotlin.idea.core.quoteIfNeeded
|
||||
import org.jetbrains.kotlin.idea.refactoring.broadcastRefactoringExit
|
||||
import org.jetbrains.kotlin.idea.refactoring.fqName.getKotlinFqName
|
||||
import org.jetbrains.kotlin.idea.refactoring.move.*
|
||||
import org.jetbrains.kotlin.idea.refactoring.move.moveFilesOrDirectories.MoveKotlinClassHandler
|
||||
@@ -349,5 +350,13 @@ class MoveKotlinDeclarationsProcessor(
|
||||
execute(usages.toTypedArray())
|
||||
}
|
||||
|
||||
override fun doRun() {
|
||||
try {
|
||||
super.doRun()
|
||||
} finally {
|
||||
broadcastRefactoringExit(myProject, refactoringId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCommandName(): String = REFACTORING_NAME
|
||||
}
|
||||
Reference in New Issue
Block a user