1 // Copyright 2019 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.
11 "golang.org/x/tools/internal/lsp/protocol"
12 "golang.org/x/tools/internal/span"
15 func (r *runner) SignatureHelp(t *testing.T, spn span.Span, want *protocol.SignatureHelp) {
17 filename := uri.Filename()
18 target := filename + fmt.Sprintf(":%v:%v", spn.Start().Line(), spn.Start().Column())
19 got, _ := r.NormalizeGoplsCmd(t, "signature", target)
22 t.Fatalf("want nil, but got %s", got)
26 goldenTag := want.Signatures[0].Label + "-signature"
27 expect := string(r.data.Golden(goldenTag, filename, func() ([]byte, error) {
28 return []byte(got), nil
31 t.Errorf("signature failed for %s expected:\n%q\ngot:\n%q'", filename, expect, got)