private @Nullable Deferred<?> startContributorThread(CompletionInitializationContextImpl initContext,
                                                       CompletionProgressIndicator indicator,
                                                       OffsetsInFile hostCopyOffsets,
                                                       boolean hasModifiers) {
    if (!hostCopyOffsets.getFile().isValid()) {
      completionFinished(indicator, hasModifiers);
      return null;
    }

    ApplicationManager.getApplication().getMessageBus().syncPublisher(CompletionContributorListener.TOPIC)
      .beforeCompletionContributorThreadStarted(indicator, initContext);
    return indicator.getCompletionThreading()
      .startThread(indicator, Context.current().wrap(() -> {
        CompletionThreadingKt.tryReadOrCancel(indicator, Context.current().wrap(() -> {
          OffsetsInFile finalOffsets = CompletionInitializationUtil.toInjectedIfAny(initContext.getFile(), hostCopyOffsets);
          indicator.registerChildDisposable(finalOffsets::getOffsets);

          CompletionParameters parameters = CompletionInitializationUtil.createCompletionParameters(initContext, indicator, finalOffsets);
          parameters.setIsTestingMode(isTestingMode());
          indicator.setParameters(parameters);

          indicator.runContributors(initContext);
        }));
      }));
  }
private @Nullable Deferred<?> startContributorThread(CompletionInitializationContextImpl initContext,
                                                       CompletionProgressIndicator indicator,
                                                       OffsetsInFile hostCopyOffsets,
                                                       boolean hasModifiers)