pub struct Highlighter { /* private fields */ }Expand description
One language’s parser + highlight query. Reparses on demand; the incremental edit-diff feed (0001 pillar 4) lands when the core reports edits — prototype correctness first, per-frame cost is invisible at demo file sizes.
Implementations§
Source§impl Highlighter
impl Highlighter
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Apply the transaction’s edits to the kept tree (0022 §1): cheap pointer walk at commit time; the reparse stays lazy. Drop the kept tree (0023: a mutation path that can’t produce exact edit coordinates invalidates rather than lying).
pub fn apply_edits(&mut self, edits: &[InputEdit], revision: u64)
pub fn for_path(path: &Path) -> Option<Self>
Sourcepub fn highlight(
&mut self,
rope: &Rope,
revision: u64,
first_byte: usize,
last_byte: usize,
) -> Vec<Span>
pub fn highlight( &mut self, rope: &Rope, revision: u64, first_byte: usize, last_byte: usize, ) -> Vec<Span>
Highlight spans intersecting [first_byte, last_byte) of the rope.
Reparses only when the text changed. revision is the document’s
edit counter (0020 §5: the len+first+last key under-invalidated
same-length middle edits deterministically).
Auto Trait Implementations§
impl Freeze for Highlighter
impl RefUnwindSafe for Highlighter
impl Send for Highlighter
impl Sync for Highlighter
impl Unpin for Highlighter
impl UnsafeUnpin for Highlighter
impl UnwindSafe for Highlighter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more