mirror of
https://github.com/rtk-ai/rtk.git
synced 2026-09-19 07:33:17 +08:00
3d2d244406
Two defects in `filter_ast_grep`, both verified against ast-grep 0.45.3. `ast-grep scan` diagnostics parse only on their locator line, so filtering line by line kept ` ┌─ a.rs:2:13` and dropped the rule id, severity, message and source line — at exit code 0, so it read as success. The whole-output fallback never fired because `order` was not empty. `unparsed_signal()` now passes any shape through untouched when a single non-blank line fails to parse, which is what `search.rs` already does for grep/rg. This also covers `--heading` mode and Windows drive-letter paths, where `[^:]+` cannot match `C:\src\a.rs`. The per-file overflow hint was computed as `entries.len() - max_per_file`, which ignores `max_total` cutting a file short: a file under its own cap lost its remainder with no hint at all, and a file over it under-reported the drop. Both now count against what was actually printed. The hint said "matches" while counting lines. ast-grep prints one line per matched source line and a structural match spans several, so a repo search reported "19 more matches" where five matches remained. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>