Stop tracking deleted scanner files#20111
Conversation
Confidence Score: 4/5The fix is minimal and targeted — safe to merge. The only gap worth a follow-up is that The two The core change in Reviews (1): Last reviewed commit: "Stop tracking deleted scanner files" | Re-trigger Greptile |
| self.files.retain(|file| seen_files.contains(file)); | ||
| self.mtimes.retain(|file, _| seen_files.contains(file)); |
There was a problem hiding this comment.
Stale
dirs and extensions sets after file deletion
The PR correctly prunes self.files and self.mtimes when files disappear, but self.dirs and self.extensions are only ever inserted into and never pruned. If all files inside a directory (or all files of a given extension) are deleted, those entries remain in self.dirs / self.extensions. This affects get_globs() for Auto/External sources, which calls resolve_globs(base, &self.dirs, &self.extensions) — stale directories and extensions will produce watch-glob patterns for paths that no longer exist on disk.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis pull request implements automatic cleanup of stale file entries in the scanner's internal state. The scanner previously retained references to files across scans; now it actively removes entries from 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #17532.
Test plan
CARGO_BUILD_JOBS=1 cargo test -p tailwindcss-oxide --test scanner it_should_stop_tracking_deleted_files -- --nocapture