Debian Codegraph @

gopls/internal/test/marker/testdata/hover/fileuri.txt

raw
1 This test demonstrates file uri over doc link in hover.
2
3 -- settings.json --
4 {
5 "hoverKind": "FullDocumentation"
6 }
7
8 -- flags --
9 -ignore_extra_diags
10
11 -- go.mod --
12 module example.com
13
14 go 1.18
15
16 -- main.go --
17 package main
18
19 import (
20 "example.com/foo"
21 )
22
23 func main() {
24 // Call [foo.Foo]//@hover("Foo", "Foo", Foo)
25 foo.Foo()//@hover("Foo", "Foo", fooFoo)
26 }
27
28 -- foo/foo.go --
29 // package foo defines function [Foo]//@hover("Foo", "Foo", Foo)
30 package foo
31
32 import(
33 "example.com/a"
34 "example.com/b"
35 )
36
37 // doc comment for Foo will reference the following
38 //
39 // two packages [a] and [b]
40 //
41 // a type [a.A]
42 //
43 // a type's field [a.A.A]
44 //
45 // a type's method [a.A.Bar]
46 //
47 // an interface [a.I]
48 //
49 // an interface's method [a.I.Foo]
50 //
51 // a const [b.B]
52 //
53 // a variable [b.V]
54 //
55 // a doc link [xtools github website]
56 //
57 // [xtools github website]: https://github.com/golang/tools
58 func Foo() {} //@hover("Foo", "Foo", Foo)
59 -- a/a.go --
60 package a
61
62 type A struct {
63 A string
64 }
65
66 func (*A) Bar(){}
67
68 type I interface {
69 Foo()
70 }
71
72 -- b/b.go --
73 package b
74
75 import (
76 "example.com/a"
77 )
78
79 const B = 3
80
81 var V = 4
82 -- @Foo --
83 ```go
84 func Foo()
85 ```
86
87 ---
88
89 doc comment for Foo will reference the following
90
91 two packages [a](file://$WORKDIR/foo/foo.go#5,5) and [b](file://$WORKDIR/foo/foo.go#6,5)
92
93 a type [a.A](file://$WORKDIR/a/a.go#3,6)
94
95 a type's field [a.A.A](file://$WORKDIR/a/a.go#4,5)
96
97 a type's method [a.A.Bar](file://$WORKDIR/a/a.go#7,11)
98
99 an interface [a.I](file://$WORKDIR/a/a.go#9,6)
100
101 an interface's method [a.I.Foo](file://$WORKDIR/a/a.go#10,5)
102
103 a const [b.B](file://$WORKDIR/b/b.go#7,7)
104
105 a variable [b.V](file://$WORKDIR/b/b.go#9,5)
106
107 a doc link [xtools github website](https://github.com/golang/tools)
108
109
110 ---
111
112 [`foo.Foo` on pkg.go.dev](https://pkg.go.dev/example.com/foo#Foo)
113 -- @fooFoo --
114 ```go
115 func foo.Foo()
116 ```
117
118 ---
119
120 doc comment for Foo will reference the following
121
122 two packages [a](file://$WORKDIR/foo/foo.go#5,5) and [b](file://$WORKDIR/foo/foo.go#6,5)
123
124 a type [a.A](file://$WORKDIR/a/a.go#3,6)
125
126 a type's field [a.A.A](file://$WORKDIR/a/a.go#4,5)
127
128 a type's method [a.A.Bar](file://$WORKDIR/a/a.go#7,11)
129
130 an interface [a.I](file://$WORKDIR/a/a.go#9,6)
131
132 an interface's method [a.I.Foo](file://$WORKDIR/a/a.go#10,5)
133
134 a const [b.B](file://$WORKDIR/b/b.go#7,7)
135
136 a variable [b.V](file://$WORKDIR/b/b.go#9,5)
137
138 a doc link [xtools github website](https://github.com/golang/tools)
139
140
141 ---
142
143 [`foo.Foo` on pkg.go.dev](https://pkg.go.dev/example.com/foo#Foo)