private void retainProviderAndCommitAsync(@NotNull Document document,
                                            @NotNull Object reason,
                                            @NotNull ModalityState modality) {
    FileViewProvider viewProvider = getCachedViewProvider(document);
    if (viewProvider != null && viewProvider.isEventSystemEnabled()) {
      ThreadingAssertions.assertEventDispatchThread();
      // make cached provider non-gcable temporarily (until commit end) to avoid surprising getCachedProvider()==null
      myDocumentCommitProcessor.commitAsynchronously(myProject, this, document, reason, modality, viewProvider);
    }
  }
private void retainProviderAndCommitAsync(@NotNull Document document,
                                            @NotNull Object reason,
                                            @NotNull ModalityState modality)