File: basic.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (114 lines) | stat: -rw-r--r-- 1,610 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Basic tests of textDocument/documentSymbols.

-- symbol.go --
package main

//@symbol(want)

import "io"

var _ = 1

var x = 42

var nested struct {
	nestedField struct {
		f int
	}
}

const y = 43

type Number int

type Alias = string

type NumberAlias = Number

type (
	Boolean   bool
	BoolAlias = bool
)

type Foo struct {
	Quux
	W         io.Writer
	Bar       int
	baz       string
	funcField func(int) int
}

type Quux struct {
	X, Y float64
}

type EmptyStruct struct{}

func (f Foo) Baz() string {
	return f.baz
}

func _() {}

func (q *Quux) Do() {}

func main() {
}

type Stringer interface {
	String() string
}

type ABer interface {
	B()
	A() string
}

type WithEmbeddeds interface {
	Do()
	ABer
	io.Writer
}

type EmptyInterface interface{}

func Dunk() int { return 0 }

func dunk() {}

-- @want --
(*Quux).Do "func()"
(Foo).Baz "func() string" +2 lines
ABer "interface{...}" +3 lines
ABer.A "func() string"
ABer.B "func()"
Alias "string"
BoolAlias "bool"
Boolean "bool"
Dunk "func() int"
EmptyInterface "interface{}"
EmptyStruct "struct{}"
Foo "struct{...}" +6 lines
Foo.Bar "int"
Foo.Quux "Quux"
Foo.W "io.Writer"
Foo.baz "string"
Foo.funcField "func(int) int"
Number "int"
NumberAlias "Number"
Quux "struct{...}" +2 lines
Quux.X "float64"
Quux.Y "float64"
Stringer "interface{...}" +2 lines
Stringer.String "func() string"
WithEmbeddeds "interface{...}" +4 lines
WithEmbeddeds.ABer "ABer"
WithEmbeddeds.Do "func()"
WithEmbeddeds.Writer "io.Writer"
dunk "func()"
main "func()" +1 lines
nested "struct{...}" +4 lines
nested.nestedField "struct{...}" +2 lines
nested.nestedField.f "int"
x ""
y ""