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
This commit is contained in:
Roman Golyshev
2020-05-13 21:00:19 +03:00
parent 933440dc63
commit 165b62da63
@@ -99,7 +99,6 @@ abstract class SelfTargetingIntention<TElement : PsiElement>(
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)
}