From 5f8e24eff3f8547d97d901e6c669217eac419c2b Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Thu, 10 Feb 2022 09:06:29 -0300 Subject: [PATCH 1/3] indents: update --- queries/indents.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/queries/indents.scm b/queries/indents.scm index aa9c9dd..9c84701 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -5,15 +5,19 @@ (while_expression) (if_expression) (let_binding) - (type_declaration) (switch_expression) (expression_statement) (array) (call_expression) (list) (module_declaration) + (record) ] @indent +(record (record_field) @indent) +(arguments (block) @indent) + +(variant_declaration) @auto [ "}" @@ -26,4 +30,8 @@ "{" "}" "]" + (else_clause) + (record) ] @branch + +(arguments (block) @branch) From 3c1aa878ecd202cca01c281d2945cc2ba4ec7d7b Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Thu, 10 Feb 2022 16:58:37 -0300 Subject: [PATCH 2/3] indents: add variant and update indent_end group --- queries/indents.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/queries/indents.scm b/queries/indents.scm index 9c84701..08795a9 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -12,6 +12,7 @@ (list) (module_declaration) (record) + (variant) ] @indent (record (record_field) @indent) @@ -22,6 +23,7 @@ [ "}" "]" + ")" ] @indent_end [ From 24aefeb15042efc71ee05e4a4bc8f1cd085d7f1a Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Sun, 20 Mar 2022 04:35:43 -0300 Subject: [PATCH 3/3] indents: not indent switch and error as auto --- queries/indents.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/queries/indents.scm b/queries/indents.scm index 08795a9..1dd38f8 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -18,7 +18,11 @@ (record (record_field) @indent) (arguments (block) @indent) -(variant_declaration) @auto +[ + (variant_declaration) + (switch_expression) + (ERROR) +] @auto [ "}"