diff --git a/internal/lsp/completion.go b/internal/lsp/completion.go index 1ea91183d3..fa3a6a64f7 100644 --- a/internal/lsp/completion.go +++ b/internal/lsp/completion.go @@ -33,7 +33,8 @@ func (s *Server) completion(ctx context.Context, params *protocol.CompletionPara } items, prefix, err := source.Completion(ctx, f, rng.Start) if err != nil { - return nil, err + s.log.Infof(ctx, "no completions found for %s:%v:%v", uri, int(params.Position.Line), int(params.Position.Character)) + items = []source.CompletionItem{} } return &protocol.CompletionList{ IsIncomplete: false, diff --git a/internal/lsp/server.go b/internal/lsp/server.go index b26a971e66..d41aa602a8 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -395,7 +395,7 @@ func (s *Server) SignatureHelp(ctx context.Context, params *protocol.TextDocumen } info, err := source.SignatureHelp(ctx, f, rng.Start) if err != nil { - return nil, err + s.log.Infof(ctx, "no signature help for %s:%v:%v", uri, int(params.Position.Line), int(params.Position.Character)) } return toProtocolSignatureHelp(info), nil } @@ -483,17 +483,14 @@ func (s *Server) DocumentHighlight(ctx context.Context, params *protocol.TextDoc if err != nil { return nil, err } - spn, err := m.PointSpan(params.Position) if err != nil { return nil, err } - rng, err := spn.Range(m.Converter) if err != nil { return nil, err } - spans := source.Highlight(ctx, f, rng.Start) return toProtocolHighlight(m, spans), nil } diff --git a/internal/lsp/signature_help.go b/internal/lsp/signature_help.go index 0e54a507d5..7479db4dd3 100644 --- a/internal/lsp/signature_help.go +++ b/internal/lsp/signature_help.go @@ -10,6 +10,9 @@ import ( ) func toProtocolSignatureHelp(info *source.SignatureInformation) *protocol.SignatureHelp { + if info == nil { + return &protocol.SignatureHelp{} + } return &protocol.SignatureHelp{ ActiveParameter: float64(info.ActiveParameter), ActiveSignature: 0, // there is only ever one possible signature