Expand description
hikari (光) — the one fleet-facing semantic highlight vocabulary.
The pleme-io fleet grew several byte-identical copies of a 16-variant
highlight-class enum (escriba_ts::Semantic, caixa_theme::Semantic, …).
This crate owns the single canonical definition — Semantic — plus a
total morphism to/from hikari_core::HlClass (the palette-independent
class the highlighter backends emit). Consumers re-export Semantic from
here and delete their local copy, so the vocabulary lives in one place and
every consumer inherits changes on the next dep bump.
A consumer takes ONE dependency: HlClass, ByteSpan, and
HighlightSpan are re-exported.
Structs§
- Byte
Span - A byte-offset span into the document.
start <= endby construction, and (when produced throughSpanSink) both ends land on UTF-8 char boundaries. - Highlight
Span - One classified region of the document.
Enums§
- HlClass
- A palette-independent semantic highlight class. A superset of the classes
egui / tree-sitter / the fleet’s
Semanticenums produce, so every backend lowers to this one waist and the theme layer maps it to color exactly once. - Semantic
- The fleet semantic highlight class — the theme-facing vocabulary a renderer
maps to color. Variant set + order are load-bearing: they are
byte-identical to the historical
escriba_ts::Semantic/caixa_theme::Semanticso serde /JsonSchemaoutput does not drift when those crates re-export this one.
Functions§
- hlclass_
to_ semantic HlClass -> Semantic— total.HlClassis richer (it carriesType/Function/Escape/ … thatSemanticlacks), so this direction is lossy for those: they fold to the nearestSemantic(documented per arm). The mapping is chosen soSemantic -> HlClass -> Semanticis the identity.