Attachment (@NotNull Document document) { VirtualFile file = FileDocumentManager.getInstance().getFile(document); return new Attachment(file != null ? file.getPath() : "unknown.txt", document.getText()); }