refactor: remove legacy outline placeholders#2702
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughRefactors the outline model from role-flag types to a serializable outline-tree schema (EntryRole, SourcePosition/Range, OutlineEntry/Item/Member) and removes/de-scopes outline rule extraction and module wiring. ChangesOutline Model Architecture and Rule De-scoping
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2702 +/- ##
==========================================
- Coverage 86.51% 86.43% -0.08%
==========================================
Files 119 117 -2
Lines 20367 20212 -155
==========================================
- Hits 17621 17471 -150
+ Misses 2746 2741 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/cli/src/outline/model.rs`:
- Around line 184-186: The with_alias setter currently unconditionally sets
alias; change it to normalize away duplicates by only setting self.alias =
Some(alias.into()) when the provided alias is neither equal to self.name nor
equal to self.target (i.e., skip assigning alias if alias == name || alias ==
target). Update the corresponding other setter/constructor at the 239-257 region
the same way so the model never stores an alias that duplicates name or target
and tests should not expect alias to be present in those duplicate cases.
- Around line 52-76: The serialized shape must match the documented outline
contract: modify SourcePosition and SourceRange so range.start and range.end
include a `byte` field and `line`/`column` are serialized one-based (internally
can remain zero-based), and stop using `byte_offset` as the external byte
location; update the structs SourcePosition (add pub(super) byte: usize) and
SourceRange (remove or convert pub(super) byte_offset: Range<usize> into bytes
on start/end) and implement custom serde (Serialize/Deserialize) or serde
helpers to translate line/column + byte during (de)serialization so callers of
SourcePosition::new and SourceRange still use zero-based values internally but
the JSON matches the contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 86fa8f6d-429f-41ec-97df-3e40b958965a
📒 Files selected for processing (2)
crates/cli/src/outline/model.rscrates/cli/src/outline/rule.rs
3669daa to
89a0ffb
Compare
Summary
Test
Summary by CodeRabbit
Refactor
Breaking Changes