void (@NotNull Editor editor, @NotNull CompletionType completionType, @Nullable final Condition<? super PsiFile> condition) { if (ApplicationManager.getApplication().isUnitTestMode() && !TestModeFlags.is(CompletionAutoPopupHandler.ourTestingAutopopup)) { return; } boolean alwaysAutoPopup = Boolean.TRUE.equals(editor.getUserData(ALWAYS_AUTO_POPUP)); if (!CodeInsightSettings.getInstance().AUTO_POPUP_COMPLETION_LOOKUP && !alwaysAutoPopup) { return; } if (PowerSaveMode.isEnabled()) { return; } if (!CompletionServiceImpl.isPhase(CommittingDocuments.class, NoCompletion.getClass(), EmptyAutoPopup.class)) { return; } final CompletionProgressIndicator currentCompletion = CompletionServiceImpl.getCurrentCompletionProgressIndicator(); if (currentCompletion != null) { currentCompletion.closeAndFinish(true); } CommittingDocuments.scheduleAsyncCompletion(editor, completionType, condition, myProject, null); }