Repository navigation
feat: Add syntax highlighting for shell scripts (sh/bash/zsh) - #66
Conversation
Add tree-sitter-bash 0.23 to support shell script syntax highlighting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
close: #49 Implement syntax highlighting support for shell scripts (.sh, .bash, .zsh) using tree-sitter-bash parser. Changes: - Add bash language module with tree-sitter-bash integration - Register .sh, .bash, and .zsh file extensions - Enable syntax highlighting for common shell script files This allows shell scripts like install.sh and build scripts to be displayed with proper syntax highlighting during commit replay. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughAdds Bash/shell syntax highlighting: new Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Requester
participant LangMod as languages/mod.rs
participant GetLang as get_language(ext)
participant BashMod as bash.rs
Caller->>LangMod: ask for language for file.ext
LangMod->>GetLang: get_language(ext)
GetLang->>GetLang: match ext ("sh"/"bash"/"zsh")
alt matched
GetLang->>BashMod: call bash::language()
BashMod-->>GetLang: returns tree_sitter::Language
GetLang->>BashMod: read bash::HIGHLIGHT_QUERY
BashMod-->>GetLang: returns query str
GetLang-->>LangMod: returns (Language, Query)
LangMod-->>Caller: provide parser + highlight query
else no match
GetLang-->>LangMod: returns None
LangMod-->>Caller: no syntax config
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
Cargo.toml(1 hunks)src/syntax/languages/bash.rs(1 hunks)src/syntax/languages/mod.rs(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/syntax/languages/mod.rs (1)
src/syntax/languages/bash.rs (1)
language(1-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build (windows-latest)
🔇 Additional comments (3)
src/syntax/languages/mod.rs (2)
1-1: LGTM!The module declaration is correctly placed alphabetically and follows the existing pattern.
40-40: The review comment is based on incorrect assumptions about PR scope.The actual commit (76f68e2) explicitly states the PR objectives are to implement syntax highlighting for shell scripts by registering
.sh,.bash, and.zshfile extensions. The commit message makes no mention of shebang detection or extensionless file support. The current implementation correctly fulfills the stated PR scope.The review appears to be suggesting additional feature enhancements rather than identifying missing requirements from the PR objectives.
Likely an incorrect or invalid review comment.
src/syntax/languages/bash.rs (1)
1-5: LGTM!The implementation follows the exact pattern used by other language modules in the codebase. The
language()function correctly convertstree_sitter_bash::LANGUAGEtotree_sitter::Language, and theHIGHLIGHT_QUERYconstant properly re-exports the query from the tree-sitter-bash crate.
Update tree-sitter-bash from v0.23 to v0.25 to use the latest version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
close: #49
Summary
Changes
tree-sitter-bashdependency (v0.23).sh,.bash,.zshTest plan
cargo checkpassescargo testpassescargo clippy --all-targets --all-features -- -D warningspassescargo fmtappliedExample files that benefit
install.sh(commit: fd0d92b)generate_changelog.sh(commit: 4714f72)🤖 Generated with Claude Code
Summary by CodeRabbit