SyntaxTheme
Maps tree-sitter highlight captures to SpanStyle values.
Set the named field for each capture you want styled. Unset fields fall back to a parent prefix (e.g. string.escape falls back to string), and finally to baseStyle. For grammar-specific captures not covered by a field (e.g. keyword.return, variable.member), use extras; entries there win over typed fields for the same name.
Marked Immutable so Compose treats it as a stable parameter and skips recomposition when the same instance is passed. Callers must honor that contract: build a SyntaxTheme once (typically as a top-level/companion val or hoisted into a LocalSyntaxTheme) and never mutate the extras map after passing it in.
Constructors
Properties
Background painted behind the highlighted text. The Material3 SyntaxHighlightedText applies it automatically; pass theme.copy(background = null) to disable.
Overrides for capture names not represented as typed fields. Wins over typed fields for the same name. Pass a stable map instance (e.g. an immutable mapOf(...) constructed once and reused) — mutating the map after handing it to SyntaxTheme breaks the Immutable contract and leads to stale recomposition.
Style for punctuation captures.
Style for string.escape captures. Falls back to string when unset.