Skip to content

Commit

Permalink
syntax: Track parent LanguageLayer IDs
Browse files Browse the repository at this point in the history
This commit adds a `parent` field to the `LanguageLayer`. This
information is conveniently already available when we parse injections.
This will be used in the child commit to create a type that can
traverse injection layers using this information.
  • Loading branch information
the-mikedavis authored and archseer committed Mar 23, 2024
1 parent d5c2973 commit 6dd46bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ impl Syntax {
start_point: Point::new(0, 0),
end_point: Point::new(usize::MAX, usize::MAX),
}],
parent: None,
};

// track scope_descriptor: a Vec of scopes for item in tree
Expand Down Expand Up @@ -1360,6 +1361,7 @@ impl Syntax {
depth,
ranges,
flags: LayerUpdateFlags::empty(),
parent: Some(layer_id),
};

// Find an identical existing layer
Expand Down Expand Up @@ -1525,6 +1527,7 @@ pub struct LanguageLayer {
pub ranges: Vec<Range>,
pub depth: u32,
flags: LayerUpdateFlags,
parent: Option<LayerId>,
}

/// This PartialEq implementation only checks if that
Expand Down

0 comments on commit 6dd46bf

Please sign in to comment.