highlight-spans
highlight-spans parses source with Tree-sitter and returns semantic highlight ranges as (attr_id, start_byte, end_byte) spans plus an attribute table.
What You Get
SpanHighlighterfor highlighting source bytes or line slices.HighlightResult { attrs, spans }where:attrsmapsattr_id -> capture_namespanscontains byte ranges tagged byattr_id
Grammarvariants:ObjectScriptSql(using vendoredDerekStride/tree-sitter-sqlgrammar/query assets)PythonMarkdown(usingtree-sitter-mdblock+inline grammar/query constants)Mdx(temporary fallback: uses SQL highlighting)
Quick Example
use ;
Typical Next Step
Use theme-engine to resolve capture_name into styles, then pass styled ranges to a renderer (for example render-ansi).