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:
parent
a0c8b60a1b
commit
b83b4ad7c7
5 changed files with 341 additions and 31 deletions
10
crates/zed/languages/rust/indents.scm
Normal file
10
crates/zed/languages/rust/indents.scm
Normal file
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
(where_clause)
|
||||
(field_expression)
|
||||
(call_expression)
|
||||
] @indent
|
||||
|
||||
(_ "[" "]" @end) @indent
|
||||
(_ "<" ">" @end) @indent
|
||||
(_ "{" "}" @end) @indent
|
||||
(_ "(" ")" @end) @indent
|
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue