void () { ThreadingAssertions.assertEventDispatchThread(); if (isOutdated() || !shouldShowLookup()) return; while (true) { Runnable action = myAdvertiserChanges.poll(); if (action == null) break; action.run(); } if (!myLookupUpdated) { if (myLookup.getAdvertisements().isEmpty() && !isAutopopupCompletion() && !DumbService.isDumb(getProject())) { DefaultCompletionContributor.addDefaultAdvertisements(myLookup, myHasPsiElements); } myLookup.getAdvertiser().showRandomText(); } boolean justShown = false; if (!myLookup.isShown()) { if (hideAutopopupIfMeaningless()) { return; } if (!myLookup.showLookup()) { return; } justShown = true; } myLookupUpdated = true; myLookup.refreshUi(true, justShown); hideAutopopupIfMeaningless(); if (justShown) { myLookup.ensureSelectionVisible(true); } }