外观
⚠️ 免责声明:本文档由 GLM4.7 自动生成,内容可能存在错误或不完整之处。请以人工书写的官方文档为准。
批注功能让你在写作时添加批注和备注,支持批注线程(多消息讨论)和自动锚点定位,批注存储与源文件分离但保持关联。
在 VS Code 左侧活动栏中,点击 批注图标(💬 图标),即可打开批注管理面板。
批注管理提供两个视图:
andrea.commentsExplorer
andrea.commentsPanelView
每个批注是一个"线程",包含:
open
resolved
📊 批注概览 (75% 已完成) ────────────────────────────────────── ✅ 第一章.md [████████░░] 80% ✅ 第15行 (2条消息) 🔄 第20行 (3条消息) 🟠 第二章.md [██░░░░░░░] 25% 🔄 第10行 (1条消息)
Andrea Novel Helper: 添加批注
andrea.comments.add
Andrea Novel Helper: 解决批注
andrea.comments.resolve
Andrea Novel Helper: 重新打开批注
andrea.comments.reopen
树视图按层级显示:
📊 批注概览 ├─ 统计详情(已解决、待处理、涉及文件、总计) ├─ ────────────────────────── ├─ ✅ 第一章.md [████████░░] 80% │ ├─ ✅ 第15行 (2条消息) │ │ ├─ 💬 作者A (2小时前): 第一条消息 │ │ └─ 💬 作者B (1小时前): 回复内容 │ └─ 🔄 第20行 (3条消息)
批注面板提供更详细的交互界面:
使用命令 Andrea Novel Helper: 搜索批注 (andrea.commentsExplorer.search):
Andrea Novel Helper: 搜索批注
andrea.commentsExplorer.search
使用命令 Andrea Novel Helper: 按状态过滤 (andrea.commentsExplorer.filterByStatus):
Andrea Novel Helper: 按状态过滤
andrea.commentsExplorer.filterByStatus
使用命令 Andrea Novel Helper: 清除过滤条件 (andrea.commentsExplorer.clearFilter) 清除所有过滤。
Andrea Novel Helper: 清除过滤条件
andrea.commentsExplorer.clearFilter
批注会在编辑器中以装饰形式显示:
装饰样式可在 VS Code 设置中配置(AndreaNovelHelper.comments 相关设置)。
AndreaNovelHelper.comments
批注数据存储在项目目录的 novel-helper/comments/ 下:
novel-helper/comments/
workspace/ └── novel-helper/ └── comments/ ├── data/ # 批注元数据(JSON) │ ├── {commentId}.json │ └── ... ├── content/ # 批注内容(Markdown) │ ├── {commentId}.md │ ├── {docUuid}.md # 文档级批注文件 │ └── ... └── {docUuid}.json # 文档索引
data/{commentId}.json
{ version: '2.0', id: 'uuid-v4', status: 'open', // 或 'resolved' createdAt: 1234567890, updatedAt: 1234567890, docUuid: 'document-uuid', anchor: { ranges: [{ start: { line, character }, end: { line, character } }], para: { startIndex, endIndex }, selTexts: ['选中文本'], contexts: [{ before: '前文...', after: '后文...' }] }, contentFile: '{commentId}.md', messages: [ { id: 'msg-id', author: '作者名', body: '批注内容', createdAt: 1234567890 } ] }
content/{docUuid}.md
# 注解 ## 注解线程 {threadId} ### 消息 {id} - {author} ({timestamp}) **作者**: {author} **时间**: {timestamp} 批注内容
批注通过 docUuid(文档唯一标识符)与源文件关联。即使文件移动或重命名,批注仍能正确关联。
docUuid
使用命令 Andrea Novel Helper: 导出批注 (andrea.commentsExplorer.exportComments) 可导出批注数据:
Andrea Novel Helper: 导出批注
andrea.commentsExplorer.exportComments
如果文件被移动或重命名,批注可以自动重新关联。
使用命令 Andrea Novel Helper: 迁移批注到文档 (andrea.commentsExplorer.rebindFileToDocument):
Andrea Novel Helper: 迁移批注到文档
andrea.commentsExplorer.rebindFileToDocument
在树视图中右键点击:
在文档中右键点击批注关联的文本,选择 转到定义 可以跳转到批注定义。
当文档内容变化时,批注会自动尝试重新关联到正确的位置(250ms 防抖)。
批注面板支持 VS Code 的持久化机制:
andrea.comments.open
andrea.commentsExplorer.refresh
andrea.commentsExplorer.exportToMarkdown
andrea.commentsExplorer.exportToJson
批注使用锚点定位,支持多选范围和上下文。如果文档有大量修改:
批注目前使用"软删除"机制:
deleted: true
可以。批注存储在项目目录中:
文件移动后:
批注管理
批注功能让你在写作时添加批注和备注,支持批注线程(多消息讨论)和自动锚点定位,批注存储与源文件分离但保持关联。
打开批注管理
在 VS Code 左侧活动栏中,点击 批注图标(💬 图标),即可打开批注管理面板。
批注管理提供两个视图:
andrea.commentsExplorer) - 显示所有文件的批注andrea.commentsPanelView) - 当前文档的批注详情和交互界面功能概述
批注线程(Thread)
每个批注是一个"线程",包含:
open(活跃)或resolved(已解决)界面结构
添加批注
方法一:命令添加
Andrea Novel Helper: 添加批注(andrea.comments.add)方法二:在批注面板中添加
批注状态
切换状态
Andrea Novel Helper: 解决批注(andrea.comments.resolve)Andrea Novel Helper: 重新打开批注(andrea.comments.reopen)查看批注
在树视图中查看
树视图按层级显示:
在批注面板中查看
批注面板提供更详细的交互界面:
搜索和过滤
搜索批注
使用命令
Andrea Novel Helper: 搜索批注(andrea.commentsExplorer.search):状态过滤
使用命令
Andrea Novel Helper: 按状态过滤(andrea.commentsExplorer.filterByStatus):清除过滤
使用命令
Andrea Novel Helper: 清除过滤条件(andrea.commentsExplorer.clearFilter) 清除所有过滤。编辑器装饰
批注会在编辑器中以装饰形式显示:
装饰样式可在 VS Code 设置中配置(
AndreaNovelHelper.comments相关设置)。批注存储
存储位置
批注数据存储在项目目录的
novel-helper/comments/下:存储格式
JSON 元数据(
data/{commentId}.json) Markdown 内容(
content/{docUuid}.md) 文档关联
批注通过
docUuid(文档唯一标识符)与源文件关联。即使文件移动或重命名,批注仍能正确关联。批注导出
使用命令
Andrea Novel Helper: 导出批注(andrea.commentsExplorer.exportComments) 可导出批注数据:批注迁移
迁移单个批注线程
如果文件被移动或重命名,批注可以自动重新关联。
迁移整个文档的批注
使用命令
Andrea Novel Helper: 迁移批注到文档(andrea.commentsExplorer.rebindFileToDocument):右键菜单
在树视图中右键点击:
跳转到定义
在文档中右键点击批注关联的文本,选择 转到定义 可以跳转到批注定义。
自动同步
编辑器滚动同步
文档变化自动重链
当文档内容变化时,批注会自动尝试重新关联到正确的位置(250ms 防抖)。
持久化
批注面板支持 VS Code 的持久化机制:
命令列表
andrea.comments.openandrea.comments.addandrea.comments.resolveandrea.comments.reopenandrea.commentsExplorer.refreshandrea.commentsExplorer.searchandrea.commentsExplorer.filterByStatusandrea.commentsExplorer.clearFilterandrea.commentsExplorer.exportCommentsandrea.commentsExplorer.exportToMarkdownandrea.commentsExplorer.exportToJson常见问题
批注没有显示?
novel-helper/comments/目录是否存在批注位置不准确?
批注使用锚点定位,支持多选范围和上下文。如果文档有大量修改:
如何删除批注?
批注目前使用"软删除"机制:
deleted: true批注可以用于协作吗?
可以。批注存储在项目目录中:
如何移动或重命名包含批注的文件?
文件移动后:
相关功能