diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java index 5c98c2bd177a..d8d858c11a23 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java @@ -619,8 +619,8 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement closeAndFinish(false); - CompletionAutoPopupHandler.invokeCompletion(myParameters.getCompletionType(), false, - isAutopopupCompletion(), project, myEditor, myParameters.getInvocationCount(), false); + CompletionAutoPopupHandler.invokeCompletion(myParameters.getCompletionType(), + isAutopopupCompletion(), project, myEditor, myParameters.getInvocationCount()); } }); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CompletionAutoPopupHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CompletionAutoPopupHandler.java index ceae77adb23d..8aae01ccdec3 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CompletionAutoPopupHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CompletionAutoPopupHandler.java @@ -94,7 +94,7 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate { @Override public void run() { if (phase.isExpired()) return; - invokeCompletion(CompletionType.BASIC, false, true, project, editor, 0, false); + invokeCompletion(CompletionType.BASIC, true, project, editor, 0); } }; AutoPopupController.getInstance(project).invokeAutoPopupRunnable(new Runnable() { @@ -105,20 +105,9 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate { }, CodeInsightSettings.getInstance().AUTO_LOOKUP_DELAY); } - public static void invokeAutoPopupCompletion(final Project project, final Editor editor, Condition condition) { + public static void invokeAutoPopupCompletion(final Project project, final Editor editor, final Condition condition) { ApplicationManager.getApplication().assertIsDispatchThread(); - completeWhenAllDocumentsCommitted(project, editor, CompletionType.BASIC, false, true, 0, false, condition); - } - - private static void completeWhenAllDocumentsCommitted(@NotNull final Project project, - @NotNull final Editor editor, - final CompletionType completionType, - final boolean invokedExplicitly, - final boolean autopopup, - final int time, - final boolean hasModifiers, - final Condition condition) { final Document document = editor.getDocument(); final long beforeStamp = document.getModificationStamp(); final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project); @@ -141,7 +130,7 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate { } PsiFile file = documentManager.getPsiFile(document); if (file != null && condition != null && !condition.value(file)) return; - invokeCompletion(completionType, invokedExplicitly, autopopup, project, editor, time, hasModifiers); + invokeCompletion(CompletionType.BASIC, true, project, editor, 0); } }, project.getDisposed()); } @@ -149,9 +138,8 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate { } public static void invokeCompletion(CompletionType completionType, - boolean invokedExplicitly, boolean autopopup, - Project project, Editor editor, int time, boolean hasModifiers) { + Project project, Editor editor, int time) { // retrieve the injected file from scratch since our typing might have destroyed the old one completely Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(editor); PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(topLevelEditor.getDocument()); @@ -161,7 +149,7 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate { PsiDocumentManager.getInstance(project).commitAllDocuments(); Editor newEditor = InjectedLanguageUtil.getEditorForInjectedLanguageNoCommit(topLevelEditor, topLevelFile); try { - new CodeCompletionHandlerBase(completionType, invokedExplicitly, autopopup).invokeCompletion(project, newEditor, time, hasModifiers); + new CodeCompletionHandlerBase(completionType, false, autopopup).invokeCompletion(project, newEditor, time, false); } catch (IndexNotReadyException ignored) { }