aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/testdata/arraytype/array_type.go.in
blob: ac1a3e78297731c7c9ed2d4e4c0f9fdeba1319fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package arraytype

import (
	"golang.org/lsptests/foo"
)

func _() {
	var (
		val string //@item(atVal, "val", "string", "var")
	)

	// disabled - see issue #54822
	[] // complete(" //", PackageFoo)

	[]val //@complete(" //")

	[]foo.StructFoo //@complete(" //", StructFoo)

	[]foo.StructFoo(nil) //@complete("(", StructFoo)

	[]*foo.StructFoo //@complete(" //", StructFoo)

	[...]foo.StructFoo //@complete(" //", StructFoo)

	[2][][4]foo.StructFoo //@complete(" //", StructFoo)

	[]struct { f []foo.StructFoo } //@complete(" }", StructFoo)
}

func _() {
	type myInt int //@item(atMyInt, "myInt", "int", "type")

	var mark []myInt //@item(atMark, "mark", "[]myInt", "var")

	var s []myInt //@item(atS, "s", "[]myInt", "var")
	s = []m //@complete(" //", atMyInt)
	// disabled - see issue #54822
	s = [] // complete(" //", atMyInt, PackageFoo)

	var a [1]myInt
	a = [1]m //@complete(" //", atMyInt)

	var ds [][]myInt
	ds = [][]m //@complete(" //", atMyInt)
}

func _() {
	var b [0]byte //@item(atByte, "b", "[0]byte", "var")
	var _ []byte = b //@snippet(" //", atByte, "b[:]", "b[:]")
}