From d1ce3db8ea608bd5b10171ce23b2867eddad427a Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Wed, 10 Aug 2022 23:01:57 +0200 Subject: indents(go): no indent at all composite_literal, indent at struct_type --- queries/go/indents.scm | 2 +- tests/indent/go/issue-3288.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/queries/go/indents.scm b/queries/go/indents.scm index d88329c99..c6ac18969 100644 --- a/queries/go/indents.scm +++ b/queries/go/indents.scm @@ -3,7 +3,6 @@ (const_declaration) (var_declaration) (type_declaration) - (composite_literal) (func_literal) (literal_value) (expression_case) @@ -11,6 +10,7 @@ (block) (call_expression) (parameter_list) + (struct_type) ] @indent [ diff --git a/tests/indent/go/issue-3288.go b/tests/indent/go/issue-3288.go index a59208184..330dd67c5 100644 --- a/tests/indent/go/issue-3288.go +++ b/tests/indent/go/issue-3288.go @@ -7,8 +7,16 @@ func correct(word string) { select { } // <--- +} - arr := []struct { +func test() { + cases := []struct { + first, second string + } { + {"Hello", "World"}, + } - } // <--- + for range cases { + println("random stuff") + } } -- cgit v1.2.3-70-g09d2