Start on a query-based autoindent system

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-05-26 17:23:53 -07:00
co-authored by Nathan Sobo
parent 3c0673852b
commit 7bea3fd2fe
4 changed files with 196 additions and 105 deletions
+3 -2
View File
@@ -509,7 +509,7 @@ mod tests {
fn inner() {}
}"#
.unindent();
let query = tree_sitter::Query::new(
let highlight_query = tree_sitter::Query::new(
grammar,
r#"
(mod_item name: (identifier) body: _ @mod.body)
@@ -530,7 +530,8 @@ mod tests {
..Default::default()
},
grammar: grammar.clone(),
highlight_query: query,
highlight_query,
indent_query: tree_sitter::Query::new(grammar, "").unwrap(),
theme_mapping: Default::default(),
});
lang.set_theme(&theme);