1
0
mirror of https://github.com/golang/go synced 2024-10-01 18:38:34 -06:00
go/internal/lsp/testdata/godef/a/a.go.golden
Rebecca Stambler bffc5affc6 internal/lsp: support definitions and hover for builtins
This change adds support for definitions and hover for builtin types and
functions. It also includes some small (non-logic) changes to the import
spec definition function.

Additionally, there are some resulting changes in diagnostics to ignore
the builtin file but also use it for definitions (Ian, you were right
with your comment on my earlier review...).

Fixes golang/go#31696

Change-Id: I52d43d010a5ca8359b539c33e40782877eb730d0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/177517
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-05-17 00:35:10 +00:00

75 lines
1.3 KiB
Plaintext

-- Random-definition --
godef/a/random.go:3:6-12: defined here as func Random() int
-- Random-definition-json --
{
"span": {
"uri": "file://godef/a/random.go",
"start": {
"line": 3,
"column": 6,
"offset": 16
},
"end": {
"line": 3,
"column": 12,
"offset": 22
}
},
"description": "func Random() int"
}
-- Random-hover --
func Random() int
-- Random2-definition --
godef/a/random.go:8:6-13: defined here as func Random2(y int) int
-- Random2-definition-json --
{
"span": {
"uri": "file://godef/a/random.go",
"start": {
"line": 8,
"column": 6,
"offset": 71
},
"end": {
"line": 8,
"column": 13,
"offset": 78
}
},
"description": "func Random2(y int) int"
}
-- Random2-hover --
func Random2(y int) int
-- err-definition --
godef/a/a.go:14:6-9: defined here as var err error
-- err-definition-json --
{
"span": {
"uri": "file://godef/a/a.go",
"start": {
"line": 14,
"column": 6,
"offset": 201
},
"end": {
"line": 14,
"column": 9,
"offset": 204
}
},
"description": "var err error"
}
-- err-hover --
var err error
-- string-hover --
string
-- make-hover --
The make built-in function allocates and initializes an object of type slice, map, or chan (only).
func(t Type, size ...IntegerType) Type