private void updateLookup() {
    ThreadingAssertions.assertEventDispatchThread();
    if (isOutdated() || !shouldShowLookup()) return;

    while (true) {
      Runnable action = myAdvertiserChanges.poll();
      if (action == null) break;
      action.run();
    }

    if (!myLookupUpdated) {
      if (lookup.getAdvertisements().isEmpty() && !isAutopopupCompletion() && !DumbService.isDumb(getProject())) {
        DefaultCompletionContributor.addDefaultAdvertisements(lookup, myHasPsiElements);
      }
      lookup.getAdvertiser().showRandomText();
    }

    boolean justShown = false;
    if (!lookup.isShown()) {
      if (hideAutopopupIfMeaningless()) {
        return;
      }

      if (!lookup.showLookup()) {
        return;
      }
      justShown = true;
    }
    myLookupUpdated = true;
    lookup.refreshUi(true, justShown);
    hideAutopopupIfMeaningless();
    if (justShown) {
      lookup.ensureSelectionVisible(true);
    }
  }
private void updateLookup()