@@ -166,7 +166,7 @@ impl LanguageConfiguration {
168 let language = get_language(self.language_id);
168 let language = get_language(self.language_id);
169− let mut config = HighlightConfiguration::new(
169+ let config = HighlightConfiguration::new(
170 language,
170 language,
171 &highlights_query,
171 &highlights_query,
172 &injections_query,
172 &injections_query,
@@ -332,7 +332,8 @@ impl Syntax {
333 // update root layer
333 // update root layer
334 PARSER.with(|ts_parser| {
334 PARSER.with(|ts_parser| {
335+ // TODO: handle the returned `Result` properly.
335− syntax.root_layer.parse(
336+ let _ = syntax.root_layer.parse(
336 &mut ts_parser.borrow_mut(),
337 &mut ts_parser.borrow_mut(),
337 &syntax.config,
338 &syntax.config,
@@ -387,7 +388,7 @@ impl Syntax {
387 source: RopeSlice<'a>,
388 source: RopeSlice<'a>,
388 range: Option<std::ops::Range<usize>>,
389 range: Option<std::ops::Range<usize>>,
389 cancellation_flag: Option<&'a AtomicUsize>,
390 cancellation_flag: Option<&'a AtomicUsize>,
390− mut injection_callback: impl FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
391+ injection_callback: impl FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
391 ) -> impl Iterator<Item = Result<HighlightEvent, Error>> + 'a {
392 ) -> impl Iterator<Item = Result<HighlightEvent, Error>> + 'a {
392 // The `captures` iterator borrows the `Tree` and the `QueryCursor`, which
393 // The `captures` iterator borrows the `Tree` and the `QueryCursor`, which
393 // prevents them from being moved. But both of these values are really just
394 // prevents them from being moved. But both of these values are really just
@@ -494,8 +495,8 @@ impl LanguageLayer {
494 ts_parser: &mut TsParser,
495 ts_parser: &mut TsParser,
495 config: &HighlightConfiguration,
496 config: &HighlightConfiguration,
496 source: &Rope,
497 source: &Rope,
497− mut depth: usize,
498+ _depth: usize,
498− mut ranges: Vec<Range>,
499+ ranges: Vec<Range>,
499 ) -> Result<(), Error> {
500 ) -> Result<(), Error> {
500 if ts_parser.parser.set_included_ranges(&ranges).is_ok() {
501 if ts_parser.parser.set_included_ranges(&ranges).is_ok() {
501 ts_parser
502 ts_parser
@@ -1644,13 +1645,13 @@ fn injection_for_match<'a>(
1644 (language_name, content_node, include_children)
1645 (language_name, content_node, include_children)
1647−fn shrink_and_clear<T>(vec: &mut Vec<T>, capacity: usize) {
1648+// fn shrink_and_clear<T>(vec: &mut Vec<T>, capacity: usize) {
1648− if vec.len() > capacity {
1649+// if vec.len() > capacity {
1649− vec.truncate(capacity);
1650+// vec.truncate(capacity);
1650− vec.shrink_to_fit();
1651+// vec.shrink_to_fit();
1652− vec.clear();
1653+// vec.clear();
1655pub struct Merge<I> {
1656pub struct Merge<I> {
1656 iter: I,
1657 iter: I,
@@ -1691,7 +1692,7 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
1692 match (self.next_event, &self.next_span) {
1693 match (self.next_event, &self.next_span) {
1693 // this happens when range is partially or fully offscreen
1694 // this happens when range is partially or fully offscreen
1694− (Some(Source { start, end }), Some((span, range))) if start > range.start => {
1695+ (Some(Source { start, .. }), Some((span, range))) if start > range.start => {
1695 if start > range.end {
1696 if start > range.end {
1696 self.next_span = self.spans.next();
1697 self.next_span = self.spans.next();
1697 } else {
1698 } else {
@@ -1711,7 +1712,7 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
1711 self.next_event = self.iter.next();
1712 self.next_event = self.iter.next();
1712 Some(HighlightEnd)
1713 Some(HighlightEnd)
1714− (Some(Source { start, end }), Some((span, range))) if start < range.start => {
1715+ (Some(Source { start, end }), Some((_, range))) if start < range.start => {
1715 let intersect = range.start.min(end);
1716 let intersect = range.start.min(end);
1716 let event = Source {
1717 let event = Source {
@@ -1766,7 +1767,7 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
1766 Some(event)
1767 Some(event)
1768 // can happen if deleting and cursor at EOF, and diagnostic reaches past the end
1769 // can happen if deleting and cursor at EOF, and diagnostic reaches past the end
1769− (None, Some((span, range))) => {
1770+ (None, Some((_, _))) => {
1770 self.next_span = None;
1771 self.next_span = None;
@@ -1809,7 +1810,7 @@ mod test {
1809 .collect();
1810 .collect();
1811 let language = get_language(Lang::Rust);
1812 let language = get_language(Lang::Rust);
1812− let mut config = HighlightConfiguration::new(
1813+ let config = HighlightConfiguration::new(
1813 language,
1814 language,
1814 &std::fs::read_to_string(
1815 &std::fs::read_to_string(
1815 "../helix-syntax/languages/tree-sitter-rust/queries/highlights.scm",
1816 "../helix-syntax/languages/tree-sitter-rust/queries/highlights.scm",
@@ -1853,7 +1854,7 @@ mod test {
1853 use crate::State;
1854 use crate::State;
1854 use tree_sitter::InputEdit;
1855 use tree_sitter::InputEdit;
1856− let mut state = State::new("hello world!\ntest 123".into());
1857+ let state = State::new("hello world!\ntest 123".into());
1857 let transaction = Transaction::change(
1858 let transaction = Transaction::change(
1858 &state.doc,
1859 &state.doc,
1859 vec![(6, 11, Some("test".into())), (12, 17, None)].into_iter(),
1860 vec![(6, 11, Some("test".into())), (12, 17, None)].into_iter(),