Skip to main content

Crate strop_syntax

Crate strop_syntax 

Source
Expand description

strop-syntax: tree-sitter highlighting. Parsers statically linked (0002 §2.2 — never dlopen’d grammars); queries are data (0001 §5.11), embedded defaults now, runtime overrides when config lands (0005).

The whole pipeline is rope-backed: parsing walks rope chunks, and query predicates (#eq?/#match?/…) read node text through a tree_sitter::TextProvider over the same chunks — no full-text String is materialized on any input or render path, and language detection never touches the filesystem.

Modules§

languages
One statically linked registry for native filenames, shebangs and injections. Queries are vendored from Helix under MPL-2.0; no runtime grammar downloads.

Structs§

Emphasis
GuideFrame
Highlighter
One language’s parser + highlight query. The tree tracks the buffer’s journal (0022 §1): edits apply as a cheap pointer walk at commit time and reparsing is incremental against the kept tree — a full parse is the cold-start path, not the rule.
IndentGuides
Span
A colored span, in byte offsets.

Enums§

Class
Semantic classes the renderer maps to palette colors. Kept small and stable; the query capture names map onto these.
HighlightError
Highlighting failed out loud: no hidden full-text reparse fallback, no swallowed error, no panic — the caller decides what the failure means for its surface.