Skip to content

feat(paths): implement scope-based path display resolution#7

Open
botirk38 wants to merge 1 commit intomasterfrom
feat/rg-compat-partials
Open

feat(paths): implement scope-based path display resolution#7
botirk38 wants to merge 1 commit intomasterfrom
feat/rg-compat-partials

Conversation

@botirk38
Copy link
Copy Markdown
Owner

@botirk38 botirk38 commented Apr 3, 2026

Summary

Implements proper path display resolution based on user-provided search scopes, addressing the "Default path printing" partial row in the rg compatibility matrix.

  • Add PathDisplay enum (Relative/Absolute) to control path output format
  • Refactor effective_path_display() in CLI to use user-provided scopes only
  • Update core to use resolved display path through SearchLineStyle.path_display
  • Unified path printing in execute.rs via display_path_for_candidate()
  • Update StandardSink to store String display_path instead of &Path
  • Fix integration tests to expect correct absolute/relative paths
  • Update rg-compat-matrix.md to reflect implemented status
  • No runtime rg dependency in tests; use ripgrep clone as manual reference

Behavior

  • If any search scope is absolute (e.g., sift pattern /tmp/foo), paths are printed absolute
  • If all scopes are relative (e.g., sift pattern ./foo or just sift pattern), paths are printed relative
  • This applies to both indexed and walk search modes
  • Follows ripgrep semantics for path display

Testing

  • All CLI integration tests pass (90+)
  • All core unit tests pass (37)
  • cargo fmt --check passes
  • cargo clippy -D warnings passes

- Add PathDisplay enum (Relative/Absolute) to control path output format
- Refactor effective_path_display() in CLI to use user-provided scopes only
- Update core to use resolved display path through SearchLineStyle.path_display
- Unified path printing in execute.rs via display_path_for_candidate()
- Update StandardSink to store String display_path instead of &Path
- Fix integration tests to expect correct absolute/relative paths
- Update rg-compat-matrix.md to reflect implemented status
- No runtime rg dependency in tests; use ripgrep clone as manual reference
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