Start work on a Buffer API for requesting autoindent on the next parse

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2021-10-06 16:09:30 -07:00
parent a0c8b60a1b
commit b83b4ad7c7
5 changed files with 341 additions and 31 deletions

View file

@ -0,0 +1,10 @@
[
(where_clause)
(field_expression)
(call_expression)
] @indent
(_ "[" "]" @end) @indent
(_ "<" ">" @end) @indent
(_ "{" "}" @end) @indent
(_ "(" ")" @end) @indent

View file

@ -22,6 +22,8 @@ fn rust() -> Language {
.unwrap()
.with_brackets_query(load_query("rust/brackets.scm").as_ref())
.unwrap()
.with_indents_query(load_query("rust/indents.scm").as_ref())
.unwrap()
}
fn load_query(path: &str) -> Cow<'static, str> {