Preserve source text and annotation metadata #25
MergedM-Hassan-Raza(GitHub profile, opens in a new tab)merged 6 commits into
main fromrefs/pull/25/headmerged by tannerlinsley tannerlinsley merged this1e75b89
tannerlinsley closed this
Sign in to join this conversation.
Warning
Review limit reached#
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 21 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
4f25f709-a89f-4d7a-9698-1c7faad396e9Reviewing files that changed from the base of the PR and between 5b6a0db26115f2c4db080b12ae196b809063115a and 86d3adaef2a6d8ae13080a9377852ca090ae0b56.
.changeset/valid-decoration-offsets.mddocs/guides/annotations.mddocs/reference/core.mdsrc/core.tssrc/internal/render.tstest/core.test.tstest/hast-render-target.test.tsNo actionable comments were generated in the recent review.
Walkthrough
The renderer now ignores decorations with invalid offsets, clips out-of-bounds ranges as documented, updates newline traversal, and preserves arbitrary line-decoration data keys. Tests cover invalid ranges and metadata merging.
Changes: Decoration rendering
src/core.ts,test/core.test.ts,docs/guides/annotations.md,docs/reference/core.md,.changeset/valid-decoration-offsets.mdEstimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers:
tannerlinsleyMerge Risk:
Minimal · previous review
5b6a0This change makes the renderer ignore invalid decoration ranges and keep arbitrary line metadata keys. It has regression tests and updated docs. No merge-blocking risk is evident.
Architecture risk:
Medium · up to
5b6a0The change affects 3 systems.
Changed systems:
src,docs,testArchitecture concerns No architecture-level concerns identified.
Review details
Systems and components
Before / after behavior
start < endrequirement, ignoring invalid ranges, and clipping ranges that extend beyond the source.startis not less thanendare ignored, and that out-of-bounds ranges are clipped to the source.renderTokensnow filters range decorations to integer offsets withstart < end. It replaces thewrapLinesflag with a direct check for line numbers or line decorations, and iterates through the code by locating newline characters.hasNewline-based newline emission.Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (3 skipped: 3 unsupported.)
Finishing Touches
🧪 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.
Share
CodeRabbit Verify#
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
c873ad8c-b720-4302-86b9-324261700882📥 Commits
Reviewing files that changed from the base of the PR and between 8c2a665876d44af388e21ef71abbe9b09e740156 and 5b6a0db26115f2c4db080b12ae196b809063115a.
📒 Files selected for processing (5)
.changeset/valid-decoration-offsets.mddocs/guides/annotations.mddocs/reference/core.mdsrc/core.tstest/core.test.tsIncluded review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.