Skip to content

M23-A: SyntaxTheme and highlight.rs scaffolding #345

@bug-ops

Description

@bug-ops

Parent: #344

Scope

  • Add tree-sitter-highlight to workspace deps
  • Add tree-sitter + grammar crates to zeph-tui/Cargo.toml behind feature flags
  • Create SyntaxTheme struct in theme.rs with styles for: keyword, string, comment, function, type, number, operator, variable, attribute, punctuation, constant
  • Add pub syntax: SyntaxTheme field to Theme
  • Create crates/zeph-tui/src/highlight.rs with SyntaxHighlighter struct
  • SyntaxHighlighter::new() registers available grammars
  • SyntaxHighlighter::highlight(lang, code, theme) -> Option<Vec<Span>>
  • LazyLock<SyntaxHighlighter> at module level
  • Add mod highlight to lib.rs

Acceptance criteria

  • SyntaxHighlighter compiles and initializes without panic
  • At least Rust grammar registered and produces highlighted spans
  • Fallback returns None for unknown languages
  • Feature flags match zeph-index pattern (lang-rust, lang-python, lang-js, lang-config)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions