From 094203c74e19d49b3bfc74cf2ab4f853a773c195 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 28 May 2021 00:00:51 +0900 Subject: Update deps, introduce the new tree-sitter lifetimes --- helix-core/src/syntax.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'helix-core/src/syntax.rs') diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 1b8e832b..febbf821 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -745,7 +745,7 @@ struct LocalScope<'a> { local_defs: Vec>, } -struct HighlightIter<'a, F> +struct HighlightIter<'a, 'tree: 'a, F> where F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a, { @@ -753,16 +753,16 @@ where byte_offset: usize, injection_callback: F, cancellation_flag: Option<&'a AtomicUsize>, - layers: Vec>, + layers: Vec>, iter_count: usize, next_event: Option, last_highlight_range: Option<(usize, usize, usize)>, } -struct HighlightIterLayer<'a> { +struct HighlightIterLayer<'a, 'tree: 'a> { _tree: Option, cursor: QueryCursor, - captures: iter::Peekable>>, + captures: iter::Peekable>>, config: &'a HighlightConfiguration, highlight_end_stack: Vec, scope_stack: Vec>, @@ -929,7 +929,7 @@ impl HighlightConfiguration { } } -impl<'a> HighlightIterLayer<'a> { +impl<'a, 'tree: 'a> HighlightIterLayer<'a, 'tree> { /// Create a new 'layer' of highlighting for this document. /// /// In the even that the new layer contains "combined injections" (injections where multiple @@ -1193,7 +1193,7 @@ impl<'a> HighlightIterLayer<'a> { } } -impl<'a, F> HighlightIter<'a, F> +impl<'a, 'tree: 'a, F> HighlightIter<'a, 'tree, F> where F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a, { @@ -1244,7 +1244,7 @@ where } } - fn insert_layer(&mut self, mut layer: HighlightIterLayer<'a>) { + fn insert_layer(&mut self, mut layer: HighlightIterLayer<'a, 'tree>) { if let Some(sort_key) = layer.sort_key() { let mut i = 1; while i < self.layers.len() { @@ -1263,7 +1263,7 @@ where } } -impl<'a, F> Iterator for HighlightIter<'a, F> +impl<'a, 'tree: 'a, F> Iterator for HighlightIter<'a, 'tree, F> where F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a, { -- cgit v1.2.3-70-g09d2