aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-02-24 03:58:50 -0500
committerStephan Seitz <stephan.seitz@fau.de>2023-02-24 01:37:58 -0800
commita3213e3dd7fc9a7fdaa402dacccf7a554dc2a848 (patch)
treec8d07cda1c3c77fc8e7f4f79275ee95bdcc513a5
parentUpdate README (diff)
downloadnvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.tar
nvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.tar.gz
nvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.tar.bz2
nvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.tar.lz
nvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.tar.xz
nvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.tar.zst
nvim-treesitter-a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848.zip
fix(go): apply indents in a communication case in a select statement
-rw-r--r--queries/go/indents.scm1
-rw-r--r--tests/indent/go/select.go16
2 files changed, 17 insertions, 0 deletions
diff --git a/queries/go/indents.scm b/queries/go/indents.scm
index c6ac18969..e21fc8771 100644
--- a/queries/go/indents.scm
+++ b/queries/go/indents.scm
@@ -6,6 +6,7 @@
(func_literal)
(literal_value)
(expression_case)
+ (communication_case)
(default_case)
(block)
(call_expression)
diff --git a/tests/indent/go/select.go b/tests/indent/go/select.go
new file mode 100644
index 000000000..e3610f8f1
--- /dev/null
+++ b/tests/indent/go/select.go
@@ -0,0 +1,16 @@
+// issue #4248
+package main
+
+import (
+ "context"
+ "fmt"
+)
+
+func test(ch byte) {
+ ctx := context.TODO()
+ select {
+ case <-ctx.Done():
+ fmt.Println("indentation")
+ default:
+ }
+}