Package-level declarations
Types
A stateful, single-threaded highlighter that reuses prior parse / capture / span work across successive update calls. Use this for editor-style scenarios where the source code changes incrementally; for one-shot or whole-file recomposition the existing highlight / rememberHighlightedString paths remain the right choice.
Maps tree-sitter highlight captures to SpanStyle values.
Properties
Composition local providing the active SyntaxTheme. Defaults to SyntaxTheme.DarkDefault. SyntaxHighlightedText reads from this local when its theme parameter is omitted.
Functions
Returns an AnnotatedString of code with theme styles applied to tree-sitter capture spans defined by language. Each capture name is resolved through SyntaxTheme.resolve, which falls back along dotted prefixes (e.g. string.escape ->string) before yielding null.
Composable wrapper around highlight that caches the parsed tree-sitter Tree across theme-only changes. The first stage is keyed on (code, language) and re-parses only when one of those changes; the second stage applies theme to the cached tree. Native memory of the dropped tree is reclaimed by the JVM Cleaner registered in ktreesitter's Parser/Tree init blocks (no explicit disposal API exists).
Async variant of rememberHighlightedString that runs highlight off the calling thread.