pub struct SyntaxTheme {
pub keyword: Style,
pub string: Style,
pub comment: Style,
pub function: Style,
pub type: Style,
pub number: Style,
pub operator: Style,
pub variable: Style,
pub attribute: Style,
pub punctuation: Style,
pub constant: Style,
pub default: Style,
}Expand description
Ratatui Style mappings for tree-sitter syntax-highlight capture groups.
Each field corresponds to a tree-sitter capture name (e.g. "keyword",
"string", "comment"). The crate::highlight::SyntaxHighlighter uses
this struct to map highlight events to terminal styles.
The Default implementation provides a dark One Dark-inspired palette.
§Examples
use zeph_tui::theme::SyntaxTheme;
let theme = SyntaxTheme::default();
// Keywords are rendered bold.
use ratatui::style::Modifier;
assert!(theme.keyword.add_modifier.contains(Modifier::BOLD));Fields§
§keyword: StyleStyle for language keywords (e.g. fn, let, if).
string: StyleStyle for string literals.
comment: StyleStyle for comments.
function: StyleStyle for function names.
type: StyleStyle for type names and constructors.
number: StyleStyle for numeric literals.
operator: StyleStyle for operators.
variable: StyleStyle for variable names and parameters.
attribute: StyleStyle for attributes and annotations.
punctuation: StyleStyle for punctuation tokens.
constant: StyleStyle for constants and built-in values.
default: StyleFallback style for unstyled source text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyntaxTheme
impl RefUnwindSafe for SyntaxTheme
impl Send for SyntaxTheme
impl Sync for SyntaxTheme
impl Unpin for SyntaxTheme
impl UnsafeUnpin for SyntaxTheme
impl UnwindSafe for SyntaxTheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request