@@ -166,7 +166,7 @@ impl LanguageConfiguration {
166166 None
167167 } else {
168168 let language = get_language(self.language_id);
169− let mut config = HighlightConfiguration::new(
169+ let config = HighlightConfiguration::new(
170170 language,
171171 &highlights_query,
172172 &injections_query,
@@ -332,7 +332,8 @@ impl Syntax {
332332
333333 // update root layer
334334 PARSER.with(|ts_parser| {
335− syntax.root_layer.parse(
335+ // TODO: handle the returned `Result` properly.
336+ let _ = syntax.root_layer.parse(
336337 &mut ts_parser.borrow_mut(),
337338 &syntax.config,
338339 source,
@@ -387,7 +388,7 @@ impl Syntax {
387388 source: RopeSlice<'a>,
388389 range: Option<std::ops::Range<usize>>,
389390 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,
391392 ) -> impl Iterator<Item = Result<HighlightEvent, Error>> + 'a {
392393 // The `captures` iterator borrows the `Tree` and the `QueryCursor`, which
393394 // prevents them from being moved. But both of these values are really just
@@ -494,8 +495,8 @@ impl LanguageLayer {
494495 ts_parser: &mut TsParser,
495496 config: &HighlightConfiguration,
496497 source: &Rope,
497− mut depth: usize,
498− mut ranges: Vec<Range>,
498+ _depth: usize,
499+ ranges: Vec<Range>,
499500 ) -> Result<(), Error> {
500501 if ts_parser.parser.set_included_ranges(&ranges).is_ok() {
501502 ts_parser
@@ -1644,13 +1645,13 @@ fn injection_for_match<'a>(
16441645 (language_name, content_node, include_children)
16451646}
16461647
1647−fn shrink_and_clear<T>(vec: &mut Vec<T>, capacity: usize) {
1648− if vec.len() > capacity {
1649− vec.truncate(capacity);
1650− vec.shrink_to_fit();
1651− }
1652− vec.clear();
1653−}
1648+// fn shrink_and_clear<T>(vec: &mut Vec<T>, capacity: usize) {
1649+// if vec.len() > capacity {
1650+// vec.truncate(capacity);
1651+// vec.shrink_to_fit();
1652+// }
1653+// vec.clear();
1654+// }
16541655
16551656pub struct Merge<I> {
16561657 iter: I,
@@ -1691,7 +1692,7 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
16911692 loop {
16921693 match (self.next_event, &self.next_span) {
16931694 // 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 => {
16951696 if start > range.end {
16961697 self.next_span = self.spans.next();
16971698 } else {
@@ -1711,7 +1712,7 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
17111712 self.next_event = self.iter.next();
17121713 Some(HighlightEnd)
17131714 }
1714− (Some(Source { start, end }), Some((span, range))) if start < range.start => {
1715+ (Some(Source { start, end }), Some((_, range))) if start < range.start => {
17151716 let intersect = range.start.min(end);
17161717 let event = Source {
17171718 start,
@@ -1766,7 +1767,7 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
17661767 Some(event)
17671768 }
17681769 // can happen if deleting and cursor at EOF, and diagnostic reaches past the end
1769− (None, Some((span, range))) => {
1770+ (None, Some((_, _))) => {
17701771 self.next_span = None;
17711772 None
17721773 }
@@ -1809,7 +1810,7 @@ mod test {
18091810 .collect();
18101811
18111812 let language = get_language(Lang::Rust);
1812− let mut config = HighlightConfiguration::new(
1813+ let config = HighlightConfiguration::new(
18131814 language,
18141815 &std::fs::read_to_string(
18151816 "../helix-syntax/languages/tree-sitter-rust/queries/highlights.scm",
@@ -1853,7 +1854,7 @@ mod test {
18531854 use crate::State;
18541855 use tree_sitter::InputEdit;
18551856
1856− let mut state = State::new("hello world!\ntest 123".into());
1857+ let state = State::new("hello world!\ntest 123".into());
18571858 let transaction = Transaction::change(
18581859 &state.doc,
18591860 vec![(6, 11, Some("test".into())), (12, 17, None)].into_iter(),