Compare commits

...

5 commits

Author SHA1 Message Date
Bruno BELANYI 6216812a33 Add variable declarations indents
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-12 20:45:07 +02:00
Bruno BELANYI 5545b9c926 Add values indents 2022-06-12 20:45:07 +02:00
Bruno BELANYI 8a56748e88 Add functions indents 2022-06-12 20:45:07 +02:00
Bruno BELANYI 7975ca2486 Add groupings indents 2022-06-12 20:40:56 +02:00
Bruno BELANYI bca103a393 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.
2022-06-12 20:38:51 +02:00

View file

@ -1,20 +1,52 @@
; 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
; }}}
; Groups {{{
(let_expression) @indent
"in" @branch
"end" @branch
(sequence_expression) @indent
")" @branch
; }}}
; Functions and methods {{{
(parameters) @indent
(function_call) @indent
(method_call) @indent
")" @branch
(function_declaration) @indent
(primitive_declaration) @indent
(method_declaration) @indent
; }}}
; Values and expressions {{{
(array_value) @indent
"]" @branch
(array_expression) @indent
"of" @branch
(record_expression) @indent
"}" @branch
(variable_declaration) @indent
; }}}
; Misc{{{