Skip to content

Commit 9ac17cb

Browse files
committed
minor: Document Highlighter active_highlights
1 parent 5c0fd31 commit 9ac17cb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

highlighter/src/highlighter.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,20 @@ pub struct LayerData {
160160
pub struct Highlighter<'a, 'tree, Loader: LanguageLoader> {
161161
query: QueryIter<'a, 'tree, HighlightQueryLoader<&'a Loader>, ()>,
162162
next_query_event: Option<QueryIterEvent<'tree, ()>>,
163+
/// The stack of currently active highlights.
164+
/// The ranges of the highlights stack, so each highlight in the Vec must have a starting
165+
/// point `>=` the starting point of the next highlight in the Vec and and ending point `<=`
166+
/// the ending point of the next highlight in the Vec.
167+
///
168+
/// For a visual:
169+
///
170+
/// ```text
171+
/// | C |
172+
/// | B |
173+
/// | A |
174+
/// ```
175+
///
176+
/// would be `vec![A, B, C]`.
163177
active_highlights: Vec<HighlightedNode>,
164178
next_highlight_end: u32,
165179
next_highlight_start: u32,

0 commit comments

Comments
 (0)