From 165b62da63be3a95aa58382d89ee4f271d8c59d9 Mon Sep 17 00:00:00 2001 From: Roman Golyshev Date: Wed, 13 May 2020 21:00:19 +0300 Subject: [PATCH] KT-38841 Remove redundant `preparePsiElementForWrite` call - This call breaks Intention Preview for all intentions that extend `SelfTargetingIntention` - This check is actually already performed by the platform before the intention invocation - There are many other intentions which redundantly use this call, but most of them implement `LocalQuickFix`, which means that they are inspection based. Currently Intention Preview does not seem to support this kind of intentions --- .../jetbrains/kotlin/idea/intentions/SelfTargetingIntention.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/SelfTargetingIntention.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/SelfTargetingIntention.kt index 814ee9e4481..c7bbeb2afbc 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/SelfTargetingIntention.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/SelfTargetingIntention.kt @@ -99,7 +99,6 @@ abstract class SelfTargetingIntention( final override fun invoke(project: Project, editor: Editor?, file: PsiFile) { editor ?: return val target = getTarget(editor, file) ?: return - if (!FileModificationService.getInstance().preparePsiElementForWrite(target)) return applyTo(target, editor) }