mirror of https://github.com/golang/go.git
internal/lsp: propagate hoverKind to completion documentation
Fixes golang/go#33653 Change-Id: Ia45e4f4b7377681619303a6d414d9b9de3143c01 Reviewed-on: https://go-review.googlesource.com/c/tools/+/190400 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
3100af0b0e
commit
2562441715
|
|
@ -32,8 +32,9 @@ func (s *Server) completion(ctx context.Context, params *protocol.CompletionPara
|
|||
return nil, err
|
||||
}
|
||||
candidates, surrounding, err := source.Completion(ctx, view, f, rng.Start, source.CompletionOptions{
|
||||
DeepComplete: s.useDeepCompletions,
|
||||
WantDocumentaton: s.wantCompletionDocumentation,
|
||||
DeepComplete: s.useDeepCompletions,
|
||||
WantDocumentaton: s.wantCompletionDocumentation,
|
||||
WantFullDocumentation: s.hoverKind == fullDocumentation,
|
||||
})
|
||||
if err != nil {
|
||||
log.Print(ctx, "no completions found", tag.Of("At", rng), tag.Of("Failure", err))
|
||||
|
|
|
|||
|
|
@ -304,8 +304,9 @@ type candidate struct {
|
|||
}
|
||||
|
||||
type CompletionOptions struct {
|
||||
DeepComplete bool
|
||||
WantDocumentaton bool
|
||||
DeepComplete bool
|
||||
WantDocumentaton bool
|
||||
WantFullDocumentation bool
|
||||
}
|
||||
|
||||
// Completion returns a list of possible candidates for completion, given a
|
||||
|
|
|
|||
|
|
@ -137,6 +137,9 @@ func (c *completer) item(cand candidate) (CompletionItem, error) {
|
|||
goto Return
|
||||
}
|
||||
item.Documentation = hover.Synopsis
|
||||
if c.opts.WantFullDocumentation {
|
||||
item.Documentation = hover.FullDocumentation
|
||||
}
|
||||
}
|
||||
Return:
|
||||
return item, nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue