| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package misc |
| 6 |
|
| 7 |
import ( |
| 8 |
"testing" |
| 9 |
|
| 10 |
"golang.org/x/tools/gopls/internal/protocol" |
| 11 |
. "golang.org/x/tools/gopls/internal/test/integration" |
| 12 |
) |
| 13 |
|
| 14 |
|
| 15 |
func TestCallHierarchy_Issue49125(t *testing.T) { |
| 16 |
const files = ` |
| 17 |
-- go.mod -- |
| 18 |
module mod.com |
| 19 |
|
| 20 |
go 1.12 |
| 21 |
-- p.go -- |
| 22 |
package pkg |
| 23 |
` |
| 24 |
|
| 25 |
Run(t, files, func(t *testing.T, env *Env) { |
| 26 |
env.OpenFile("p.go") |
| 27 |
loc := env.RegexpSearch("p.go", "pkg") |
| 28 |
|
| 29 |
var params protocol.CallHierarchyPrepareParams |
| 30 |
params.TextDocument.URI = loc.URI |
| 31 |
params.Position = loc.Range.Start |
| 32 |
|
| 33 |
|
| 34 |
env.Editor.Server.PrepareCallHierarchy(env.Ctx, ¶ms) |
| 35 |
}) |
| 36 |
} |