Debian Codegraph @

gopls/internal/test/integration/misc/call_hierarchy_test.go

raw symbols SCIP
1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
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 // Test for golang/go#49125
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 // TODO(rfindley): this could probably just be a marker test.
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 // Check that this doesn't panic.
34 env.Editor.Server.PrepareCallHierarchy(env.Ctx, &params)
35 })
36 }