syntax: Track parent LanguageLayer IDs

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.
pull/9973/head
Michael Davis 11 months ago committed by Blaž Hrastnik
parent d5c2973cd1
commit 6dd46bfe1c

@ -1090,6 +1090,7 @@ impl Syntax {
start_point: Point::new(0, 0), start_point: Point::new(0, 0),
end_point: Point::new(usize::MAX, usize::MAX), end_point: Point::new(usize::MAX, usize::MAX),
}], }],
parent: None,
}; };
// track scope_descriptor: a Vec of scopes for item in tree // track scope_descriptor: a Vec of scopes for item in tree
@ -1360,6 +1361,7 @@ impl Syntax {
depth, depth,
ranges, ranges,
flags: LayerUpdateFlags::empty(), flags: LayerUpdateFlags::empty(),
parent: Some(layer_id),
}; };
// Find an identical existing layer // Find an identical existing layer
@ -1525,6 +1527,7 @@ pub struct LanguageLayer {
pub ranges: Vec<Range>, pub ranges: Vec<Range>,
pub depth: u32, pub depth: u32,
flags: LayerUpdateFlags, flags: LayerUpdateFlags,
parent: Option<LayerId>,
} }
/// This PartialEq implementation only checks if that /// This PartialEq implementation only checks if that

Loading…
Cancel
Save