aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/testdata/folding/a.go
diff options
context:
space:
mode:
Diffstat (limited to 'gopls/internal/lsp/testdata/folding/a.go')
-rw-r--r--gopls/internal/lsp/testdata/folding/a.go75
1 files changed, 75 insertions, 0 deletions
diff --git a/gopls/internal/lsp/testdata/folding/a.go b/gopls/internal/lsp/testdata/folding/a.go
new file mode 100644
index 000000000..e07d7e0bf
--- /dev/null
+++ b/gopls/internal/lsp/testdata/folding/a.go
@@ -0,0 +1,75 @@
+package folding //@fold("package")
+
+import (
+ "fmt"
+ _ "log"
+)
+
+import _ "os"
+
+// bar is a function.
+// With a multiline doc comment.
+func bar() string {
+ /* This is a single line comment */
+ switch {
+ case true:
+ if true {
+ fmt.Println("true")
+ } else {
+ fmt.Println("false")
+ }
+ case false:
+ fmt.Println("false")
+ default:
+ fmt.Println("default")
+ }
+ /* This is a multiline
+ block
+ comment */
+
+ /* This is a multiline
+ block
+ comment */
+ // Followed by another comment.
+ _ = []int{
+ 1,
+ 2,
+ 3,
+ }
+ _ = [2]string{"d",
+ "e",
+ }
+ _ = map[string]int{
+ "a": 1,
+ "b": 2,
+ "c": 3,
+ }
+ type T struct {
+ f string
+ g int
+ h string
+ }
+ _ = T{
+ f: "j",
+ g: 4,
+ h: "i",
+ }
+ x, y := make(chan bool), make(chan bool)
+ select {
+ case val := <-x:
+ if val {
+ fmt.Println("true from x")
+ } else {
+ fmt.Println("false from x")
+ }
+ case <-y:
+ fmt.Println("y")
+ default:
+ fmt.Println("default")
+ }
+ // This is a multiline comment
+ // that is not a doc comment.
+ return `
+this string
+is not indented`
+}