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