public static @Nullable Document getDocument(@NotNull Project project, @NotNull VirtualFile file) {
    PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
    return psiFile == null ? null : PsiDocumentManager.getInstance(project).getDocument(psiFile);
  }
public static @Nullable Document getDocument(@NotNull Project project, @NotNull VirtualFile file)