Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/go/indents.scm')
-rw-r--r--runtime/queries/go/indents.scm21
1 files changed, 4 insertions, 17 deletions
diff --git a/runtime/queries/go/indents.scm b/runtime/queries/go/indents.scm
index b2befab0..f72ec9e8 100644
--- a/runtime/queries/go/indents.scm
+++ b/runtime/queries/go/indents.scm
@@ -14,27 +14,14 @@
(argument_list)
(field_declaration_list)
(block)
+ (type_switch_statement)
+ (expression_switch_statement)
(var_declaration)
] @indent
[
+ "case"
+ "}"
"]"
")"
] @outdent
-
-; Switches and selects aren't indented, only their case bodies are.
-; Outdent all closing braces except those closing switches or selects.
-(
- (_ "}" @outdent) @outer
- (#not-kind-eq? @outer "select_statement")
- (#not-kind-eq? @outer "type_switch_statement")
- (#not-kind-eq? @outer "expression_switch_statement")
-)
-
-; Starting a line after a new case should indent.
-[
- (communication_case)
- (expression_case)
- (default_case)
- (type_case)
-] @extend