1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:34:40 -07:00
go/internal/lsp/testdata/godef/b/e.go.golden
Rebecca Stambler cfcbc7796e internal/lsp: improve link in documentation on hover
This change refactors some of the logic that builds a link anchor for
a given symbol, pushing the actual Link into the HoverInformation struct.
This is necessary because type information is needed to build up that
link in certain cases, like methods.

The last step will be to correctly display struct fields.

Updates golang/go#34240
Fixes golang/go#36031

Change-Id: I7f989faddbaa07f91838a870b4477bf78ce8ddf7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210201
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2019-12-12 22:39:21 +00:00

129 lines
2.9 KiB
Plaintext

-- Member-definition --
godef/a/d.go:6:2-8: defined here as \@Member
[`(a.Thing).Member` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Thing.Member)
```go
field Member string
```
-- Member-definition-json --
{
"span": {
"uri": "file://godef/a/d.go",
"start": {
"line": 6,
"column": 2,
"offset": 55
},
"end": {
"line": 6,
"column": 8,
"offset": 61
}
},
"description": "\\@Member\n\n[`(a.Thing).Member` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Thing.Member)\n\n```go\nfield Member string\n```"
}
-- Member-hover --
\@Member
[`(a.Thing).Member` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Thing.Member)
```go
field Member string
```
-- Other-definition --
godef/a/d.go:9:5-10: defined here as [`a.Other` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Other)
```go
var a.Other a.Thing
```
-- Other-definition-json --
{
"span": {
"uri": "file://godef/a/d.go",
"start": {
"line": 9,
"column": 5,
"offset": 86
},
"end": {
"line": 9,
"column": 10,
"offset": 91
}
},
"description": "[`a.Other` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Other)\n\n```go\nvar a.Other a.Thing\n```"
}
-- Other-hover --
[`a.Other` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Other)
```go
var a.Other a.Thing
```
-- Thing-definition --
godef/a/d.go:5:6-11: defined here as [`a.Thing` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Thing)
```go
Thing struct {
Member string //@Member
}
```
-- Thing-definition-json --
{
"span": {
"uri": "file://godef/a/d.go",
"start": {
"line": 5,
"column": 6,
"offset": 30
},
"end": {
"line": 5,
"column": 11,
"offset": 35
}
},
"description": "[`a.Thing` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Thing)\n\n```go\nThing struct {\n\tMember string //@Member\n}\n```"
}
-- Thing-hover --
[`a.Thing` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Thing)
```go
Thing struct {
Member string //@Member
}
```
-- Things-definition --
godef/a/d.go:11:6-12: defined here as [`a.Things` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Things)
```go
func a.Things(val []string) []a.Thing
```
-- Things-definition-json --
{
"span": {
"uri": "file://godef/a/d.go",
"start": {
"line": 11,
"column": 6,
"offset": 113
},
"end": {
"line": 11,
"column": 12,
"offset": 119
}
},
"description": "[`a.Things` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Things)\n\n```go\nfunc a.Things(val []string) []a.Thing\n```"
}
-- Things-hover --
[`a.Things` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a#Things)
```go
func a.Things(val []string) []a.Thing
```