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:
committed by
Roman Golyshev
parent
576948eded
commit
b0bd39e715
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user