Quick Fixes: Avoid premature write action when calling Change Signature in
interactive mode #KT-8722 Fixed
This commit is contained in:
@@ -45,6 +45,8 @@ public class ConvertParameterToReceiverIntention : JetSelfTargetingIntention<Jet
|
||||
}
|
||||
}
|
||||
|
||||
override fun startInWriteAction() = false
|
||||
|
||||
override fun applyTo(element: JetParameter, editor: Editor) {
|
||||
val function = element.getStrictParentOfType<JetNamedFunction>() ?: return
|
||||
val parameterIndex = function.getValueParameters().indexOf(element)
|
||||
|
||||
@@ -41,6 +41,8 @@ public class ConvertReceiverToParameterIntention : JetSelfTargetingOffsetIndepen
|
||||
}
|
||||
}
|
||||
|
||||
override fun startInWriteAction() = false
|
||||
|
||||
override fun applyTo(element: JetTypeReference, editor: Editor) {
|
||||
val function = element.getParent() as? JetNamedFunction ?: return
|
||||
val context = function.analyze()
|
||||
|
||||
@@ -75,8 +75,6 @@ public class AddFunctionParametersFix(
|
||||
return newParametersCnt > 0
|
||||
}
|
||||
|
||||
override fun startInWriteAction() = true
|
||||
|
||||
override fun invoke(project: Project, editor: Editor?, file: JetFile) {
|
||||
runChangeSignature(project, functionDescriptor, addParameterConfiguration(), callElement.analyzeFully(), callElement, text)
|
||||
}
|
||||
|
||||
+2
@@ -37,6 +37,8 @@ public class CreateParameterFromUsageFix<E : JetElement>(
|
||||
return JetBundle.message("create.parameter.from.usage", parameterInfo.name)
|
||||
}
|
||||
|
||||
override fun startInWriteAction() = false
|
||||
|
||||
override fun invoke(project: Project, editor: Editor?, file: JetFile) {
|
||||
val config = object : JetChangeSignatureConfiguration {
|
||||
override fun configure(originalDescriptor: JetMethodDescriptor, bindingContext: BindingContext): JetMethodDescriptor {
|
||||
|
||||
Reference in New Issue
Block a user