on master help sign in
clean up combined-injections comment (#880)
commit1766bdb9d4c3df24a010041cd014b6fecb7641fa authorMichael Davis <mcarsondavis@gmail.com> dateMon 18 Oct 2021, 23:08 (5 years ago) parent7146ae9
1 file changed+1−33
helix-core/src/syntax.rs+1−33
helix-core/src/syntax.rs+1−33
@@ -527,39 +527,7 @@ impl LanguageLayer {
527527 self.tree.as_ref(),
528528 )
529529 .ok_or(Error::Cancelled)?;
530− // unsafe { syntax.parser.set_cancellation_flag(None) };
531− // let mut cursor = syntax.cursors.pop().unwrap_or_else(QueryCursor::new);
532−
533− // Process combined injections. (ERB, EJS, etc https://github.com/tree-sitter/tree-sitter/pull/526)
534− // if let Some(combined_injections_query) = &config.combined_injections_query {
535− // let mut injections_by_pattern_index =
536− // vec![(None, Vec::new(), false); combined_injections_query.pattern_count()];
537− // let matches =
538− // cursor.matches(combined_injections_query, tree.root_node(), RopeProvider(source));
539− // for mat in matches {
540− // let entry = &mut injections_by_pattern_index[mat.pattern_index];
541− // let (language_name, content_node, include_children) =
542− // injection_for_match(config, combined_injections_query, &mat, source);
543− // if language_name.is_some() {
544− // entry.0 = language_name;
545− // }
546− // if let Some(content_node) = content_node {
547− // entry.1.push(content_node);
548− // }
549− // entry.2 = include_children;
550− // }
551− // for (lang_name, content_nodes, includes_children) in injections_by_pattern_index {
552− // if let (Some(lang_name), false) = (lang_name, content_nodes.is_empty()) {
553− // if let Some(next_config) = (injection_callback)(lang_name) {
554− // let ranges =
555− // Self::intersect_ranges(&ranges, &content_nodes, includes_children);
556− // if !ranges.is_empty() {
557− // queue.push((next_config, depth + 1, ranges));
558− // }
559− // }
560− // }
561− // }
562− // }
530+
563531 self.tree = Some(tree)
564532 }
565533 Ok(())