Fix indent queries

You need to add '@indent' to the *parent* node, which whill indent the
children. For some reason I understood it as marking the node that
should be indented when I wrote these.

These were tested manually in Neovim, I need to add a way to test them
correctly though.
This commit is contained in:
Bruno BELANYI 2022-06-12 20:38:48 +02:00
parent 2b2a75af43
commit bca103a393
1 changed files with 8 additions and 10 deletions

View File

@ -1,20 +1,18 @@
; Control flow {{{
(if_expression
consequence: (_) @indent)
(if_expression) @indent
"then" @branch
"else" @branch
(while_expression
body: (_) @indent)
(while_expression) @indent
"do" @branch
(for_expression
body: (_) @indent)
(for_expression) @indent
"to" @branch
; }}}
; Class {{{
(class_declaration
fields: (_)* @indent)
(class_type
fields: (_)* @indent)
(class_declaration) @indent
(class_type) @indent
; }}}
; Misc{{{