aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis2024-01-10 18:06:57 +0000
committerBlaž Hrastnik2024-03-23 06:32:34 +0000
commit6dd46bfe1c87a4ba4d3ae2feef1270a90ef5f67b (patch)
tree96b889b12af871879cf6ca082c234f7a7bd073bd
parentd5c2973cd10c38512f6e568f097bedca46ff5f48 (diff)
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.
-rw-r--r--helix-core/src/syntax.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 0e891719..6414f3ce 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -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
@@ -1360,6 +1361,7 @@ impl Syntax {
depth,
ranges,
flags: LayerUpdateFlags::empty(),
+ parent: Some(layer_id),
};
// Find an identical existing layer
@@ -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