Repository navigation
提议:FileDiff 携带 hunk 起始行号(oldStart/newStart),让 UI 能显示真实行号 #8212
xuzijian2019
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
背景
computeHunkDiffs(packages/fs/tool-fs/src/diff.ts)用structuredPatch算出每个 hunk 后,只保留{ path, oldText, newText },hunk.oldStart/hunk.newStart被丢弃。结果是 UI 端(web DiffBlock、TUI 插件)都无法显示真实行号——文件可能已变,事后读盘反推也不可靠。提议
FileDiff(packages/core/tools/src/presentation.ts)增加两个可选字段:computeHunkDiffs直接填入hunk.oldStart/hunk.newStart。isFileDiff校验放宽即可。presentCall(无文件内容)保持省略。All reactions