feat: syntax highlighting for TUI code blocks via tree-sitter#353
Merged
feat: syntax highlighting for TUI code blocks via tree-sitter#353
Conversation
Add tree-sitter-highlight based syntax coloring for fenced code blocks in the TUI chat widget. Supports Rust, Python, JavaScript, JSON, TOML, and Bash with language aliases. Falls back to flat style for unknown languages. SyntaxHighlighter uses LazyLock singleton with 11 capture categories mapped to SyntaxTheme colors. Closes #345, closes #346, closes #347
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #353 +/- ##
==========================================
+ Coverage 79.18% 79.33% +0.14%
==========================================
Files 99 100 +1
Lines 25428 25665 +237
==========================================
+ Hits 20136 20361 +225
- Misses 5292 5304 +12
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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
theme.code_blockstyle for unknown languagesCloses #344, closes #345, closes #346, closes #347
Test plan
cargo nextest run -p zeph-tui --lib— 89 tests pass (7 new)cargo nextest run --workspace --lib --bins— 1415 tests pass, 0 regressionscargo clippy -p zeph-tui -- -D warningscleancargo +nightly fmt --checkclean