Skip to main content

Crate hjkl_syntax

Crate hjkl_syntax 

Source
Expand description

Renderer-agnostic syntax-highlighting pipeline for the hjkl editor stack.

Fully synchronous: parse and highlight run on the main thread. Call SyntaxLayer::set_language_for_path after opening a file, SyntaxLayer::apply_edits after each batch of hjkl_engine::ContentEdits, and SyntaxLayer::render_viewport to get styled spans for the visible rows.

Output is renderer-agnostic: RenderOutput::spans carries (byte_start, byte_end, [StyleSpec]) triples. A TUI adapter ([hjkl-syntax-tui]) maps these to ratatui::style::Style.

Structs§

Color
Resolved RGBA color (all channels 0–255).
DiagSign
A single diagnostic sign emitted from the syntax pipeline.
Modifiers
Per-character text modifiers.
PerfBreakdown
Per-call sub-step timings. Kept for API compat (PerfBreakdown is re-exported in the TUI shim and referenced from :perf overlay code).
RenderOutput
Per-frame output of the syntax pipeline.
StyleSpec
Foreground, background, and modifier flags for a syntax or UI element.
SyntaxLayer
Per-App syntax highlighting layer. Multiplexes per-buffer state. Fully synchronous — no background thread.

Enums§

LoadEvent
Event emitted by SyntaxLayer::poll_pending_loads.
LoadEventKind
Exhaustive view of a LoadEvent for dispatch callbacks.
SetLanguageOutcome
Outcome of SyntaxLayer::set_language_for_path.

Functions§

build_by_row
Resolve flat highlight spans into a per-row span table sized to row_count.
layer_with_theme
Build a SyntaxLayer using the given theme + language directory.

Type Aliases§

BufferId
Stable identifier for an open buffer.