KT-36068 Remove redundant commitAllDocuments calls

- Those calls seem to be redundant since the platform already
commits all documents before invoking any intention
- Also those calls are getting in the way of `Preview Intention` action
by requiring write action, which is not granted by the platform at
the moment
This commit is contained in:
Roman Golyshev
2020-03-24 22:07:27 +03:00
committed by Roman Golyshev
parent 576948eded
commit b0bd39e715
2 changed files with 0 additions and 2 deletions
@@ -169,7 +169,6 @@ abstract class IntentionBasedInspection<TElement : PsiElement> private construct
}
override fun invoke(project: Project, editor: Editor?, file: PsiFile?) {
PsiDocumentManager.getInstance(project).commitAllDocuments()
applyFix()
}
@@ -94,7 +94,6 @@ abstract class SelfTargetingIntention<TElement : PsiElement>(
final override fun invoke(project: Project, editor: Editor?, file: PsiFile) {
editor ?: return
PsiDocumentManager.getInstance(project).commitAllDocuments()
val target = getTarget(editor, file) ?: return
if (!FileModificationService.getInstance().preparePsiElementForWrite(target)) return
applyTo(target, editor)