@Nullable
    private static Document getDocument(@NotNull PsiFile file) {
      Project project = file.getProject();
      if (project.isDisposed()) {
        return null;
      }
      return ReadAction.compute(() -> file.getViewProvider().getDocument());
    }
@Nullable
    private static Document getDocument(@NotNull PsiFile file)