static int estimateDocumentLength(@NotNull VirtualFile virtualFile) {
    Document document = FileDocumentManager.getInstance().getCachedDocument(virtualFile);
    return document == null ? Math.max(0, (int)virtualFile.getLength()) : document.getTextLength();
  }
static int estimateDocumentLength(@NotNull VirtualFile virtualFile)