boolean (@NotNull VirtualFile vFile, long maxBytes) { if (vFile instanceof LightVirtualFile && !vFile.getFileType().isBinary()) { // this is an optimization in order to avoid conversion of [large] file contents to bytes int lengthInChars = ((LightVirtualFile)vFile).getContent().length(); if (lengthInChars < maxBytes / 2) { return false; } if (lengthInChars > maxBytes ) { return true; } } return vFile.getLength() > maxBytes; }