Repository navigation
fix(ast-grep): parse Windows drive-letter paths - #4060
Raymondriter wants to merge 1 commit into
Conversation
📊 Automated PR Analysis
SummaryFixes the ast-grep result parsing regex so Windows absolute paths with drive letters (e.g. Review Checklist
Linked issues: #4017 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Hey @Raymondriter, thanks for this, the drive-letter case is still broken on |
MATCH_LINE_RE used `[^:]+` for the path, which cannot cross the colon in `C:\src\a.rs:12:...`. ast-grep echoes absolute path arguments verbatim, so on Windows no line parsed and the filter fell back to full passthrough with no savings. Allow an optional drive prefix followed by `\` or `/`. Requiring the separator keeps a one-letter relative file such as `a:12:34` reading as line 12 of `a`. Closes rtk-ai#4017 Signed-off-by: Raymond Riter <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
f096717 to
360027e
Compare
Summary
MATCH_LINE_REnow accepts an optional drive prefix (C:\orC:/) ahead of the path. Absolute-path invocations on Windows parse and get grouped instead of falling back to full passthrough with 0% savings.a:12:34still reads as line 12 ofarather than a drive.unparsed_signaldoc comment: POSIX paths that contain a colon are still left to the passthrough guard.Closes #4017
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test(3783 passed, 0 clippy warnings)test_windows_drive_letter_paths_are_grouped(C:\…andD:/…shapes) fails ondevelopand passes with the fixtest_single_letter_file_is_not_a_driveguards thea:12:34ambiguity🤖 Generated with Claude Code