Skip to main content

Module syntax

Module syntax 

Source
Expand description

Tree-sitter based syntax highlighting.

When one of the syntax-* features is enabled, highlight_code uses tree-sitter grammars for accurate, language-aware highlighting. Without those features the function always returns None so callers can fall back to the built-in keyword highlighter.

Functionsยง

highlight_code
Highlight source code using tree-sitter.
is_language_supported
Returns true if tree-sitter highlighting is available for lang.