From fe1ef7ea68a923c817cf49d954fd7f7e11a4198f Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Fri, 9 Oct 2020 09:50:38 +0700 Subject: [PATCH] [java-completion] Unblock document before removing empty parentheses Fixes EA-237439 - Throwable: PostprocessReformattingAspect.postponeFormatting GitOrigin-RevId: 48a403bd7c87c29a626cf46b990520d4262b4678 --- .../src/com/intellij/codeInsight/lookup/VariableLookupItem.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java b/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java index 736adf8b6906..86bacdf2da23 100644 --- a/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java +++ b/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java @@ -254,6 +254,7 @@ public class VariableLookupItem extends LookupItem implements Typed if (ref != null && ref.getParent() instanceof PsiMethodCallExpression) { PsiExpressionList argList = ((PsiMethodCallExpression)ref.getParent()).getArgumentList(); if (argList.getExpressionCount() == 0) { + PsiDocumentManager.getInstance(argList.getProject()).doPostponedOperationsAndUnblockDocument(context.getDocument()); context.getDocument().deleteString(argList.getTextRange().getStartOffset(), argList.getTextRange().getEndOffset()); } }