private void finishCompletionProcess(boolean disposeOffsetMap) {
    cancel();

    ThreadingAssertions.assertEventDispatchThread();
    Disposer.dispose(queue);
    LookupManager.getInstance(getProject()).removePropertyChangeListener(myLookupManagerListener);

    CompletionServiceImpl.assertPhase(CompletionPhase.BgCalculation.class,
                                      CompletionPhase.ItemsCalculated.class,
                                      CompletionPhase.Synchronous.class,
                                      CompletionPhase.CommittingDocuments.class);

    CompletionProgressIndicator currentCompletion = CompletionServiceImpl.getCurrentCompletionProgressIndicator();
    LOG.assertTrue(currentCompletion == this, currentCompletion + "!=" + this);

    CompletionPhase oldPhase = CompletionServiceImpl.getCompletionPhase();
    if (oldPhase instanceof CompletionPhase.CommittingDocuments p) {
      LOG.assertTrue(oldPhase.indicator != null, oldPhase);
      p.replaced = true;
    }
    CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
    if (disposeOffsetMap) {
      disposeIndicator();
    }
  }
private void finishCompletionProcess(boolean disposeOffsetMap)