Skip to content

[0009] 修复 gf fix 对 #( 和 ) ;# 配对模式的识别#779

Merged
da-liii merged 6 commits intomainfrom
da/0009/fix
May 7, 2026
Merged

[0009] 修复 gf fix 对 #( 和 ) ;# 配对模式的识别#779
da-liii merged 6 commits intomainfrom
da/0009/fix

Conversation

@da-liii
Copy link
Copy Markdown
Contributor

@da-liii da-liii commented May 7, 2026

Summary

  • 修复 gf fix 在处理 #( 向量字面量时,因仅将 ( 的缩进作为匹配基准,导致对齐到 #) 被误判为缩进不匹配的问题。
  • ) 后面带有 ;# 注释(用于标记 vector 结束)时,原实现会删除 ) 并在别处插入新 ),导致 ;# 注释被孤立。
  • 修改 make-open-frame-from-token,使其在遇到紧邻 # 前缀的 ( 时,将 # 的缩进列作为匹配基准。
  • 增加回归测试,验证 #() ;# 的配对不再被误判。

Test plan

  • bin/gf test tools/fix/tests/liii/goldfix-repair/repair-parentheses-test.scm 通过
  • bin/gf test tests/liii/json/json-to-string-test.scm 通过
  • bin/gf fix --dry-run tests/liii/json/json-to-string-test.scm 输出与原始文件一致

🤖 Generated with Claude Code

da-liii and others added 6 commits May 7, 2026 20:35
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- fix-file 和 fix-directory 在执行 fix 前通过 os-call 调用 gf fmt
- 使用 (liii sys) 的 executable 获取当前可执行文件路径
- 拆分 fix-file-core 避免目录递归时重复调用 fmt
- 将 fix 工具的输出文案由 Processing 改为 Fixing

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
将单独出现的 # 替换为 #t,因为 # 在 Scheme 中不是有效的独立 token。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@da-liii da-liii merged commit a4d6ec3 into main May 7, 2026
4 checks passed
@da-liii da-liii deleted the da/0009/fix branch May 7, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant