mirror of
https://github.com/Gmaker689/ai-diff-preview.git
synced 2026-09-26 23:11:51 +08:00
3168e81aa6
- 核心架构搭建:四层架构设计(触发层、隔离层、Diff引擎、UI层) - 快照管理器:管理 Base/Suggest 双版本,隔离 AI 生成代码 - Diff 引擎:基于 Myers 算法计算差异,生成变更块 - 内联装饰器:红绿高亮显示删除/新增行 - CodeLens 提供器:提供 Accept/Reject 按钮 - 事务处理:Accept/Reject 原子化操作 - Claude Hooks 集成:支持 after_code_edit/after_write_file 事件 - 状态栏显示:实时显示变更状态 - 基础测试用例:7 个测试全部通过 技术栈:TypeScript + VSCode Extension API + diff 库 + esbuild
33 lines
657 B
JSON
33 lines
657 B
JSON
{
|
|
"hooks": {
|
|
"after_code_edit": {
|
|
"command": "code",
|
|
"args": [
|
|
"--command",
|
|
"aiDiffPreview.handleHook",
|
|
"--type",
|
|
"after_code_edit",
|
|
"--file",
|
|
"${file}",
|
|
"--patch",
|
|
"${patch}"
|
|
],
|
|
"description": "AI 代码编辑后触发 Diff 预览"
|
|
},
|
|
"after_write_file": {
|
|
"command": "code",
|
|
"args": [
|
|
"--command",
|
|
"aiDiffPreview.handleHook",
|
|
"--type",
|
|
"after_write_file",
|
|
"--file",
|
|
"${file}",
|
|
"--patch",
|
|
"${patch}"
|
|
],
|
|
"description": "文件写入后触发 Diff 预览"
|
|
}
|
|
}
|
|
}
|