Single-pass highlight formatting (DSK-135)#176
Merged
Conversation
Avoid clearing and rebuilding the line buffer when the highlight regex does not match; assign highlighted output directly when it does. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSternHighlightLineFormatter のハイライト処理を変更しました。highlight_default_line は Option を返すようになり、正規表現にマッチしない場合は None を返して余計な文字列生成を回避します。format_into 側は Some の場合のみバッファを更新します。実装では出力文字列の遅延確保と write! マクロによるスタイル付与を採用。マッチあり・マッチなしの両ケースをカバーするテストが更新・追加されています。 Sequence Diagram(s)上記の隠しレビュースタック内の図を参照してください。 Possibly related issues
Poem 🚥 Pre-merge checks | ❌ 2❌ Failed checks (2 warnings)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
find_iterpass; returnNonewhen nothing matches so the formatted line buffer is left unchanged.write!and assign the result directly to the output buffer when highlighting applies.Test plan
cargo test -p rustern-core --lib render::highlightMade with Cursor
Summary by CodeRabbit