1 // Copyright 2018 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.
10 "golang.org/x/tools/internal/event"
11 "golang.org/x/tools/internal/lsp/debug/tag"
12 "golang.org/x/tools/internal/lsp/protocol"
13 "golang.org/x/tools/internal/lsp/source"
16 func (s *Server) signatureHelp(ctx context.Context, params *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error) {
17 snapshot, fh, ok, release, err := s.beginFileRequest(ctx, params.TextDocument.URI, source.Go)
22 info, activeParameter, err := source.SignatureHelp(ctx, snapshot, fh, params.Position)
24 event.Error(ctx, "no signature help", err, tag.Position.Of(params.Position))
27 return &protocol.SignatureHelp{
28 Signatures: []protocol.SignatureInformation{*info},
29 ActiveParameter: uint32(activeParameter),