go/internal/lsp/source
Shoshin Nikita 769264cf08 internal/lsp/source: fix docs for fields of anonymous structs/interfaces
There are 2 different anonymous struct declarations that require
different approaches:

1. var x struct{...}
2. x := struct{...}{}

For the first one we can use the existing solution with a minor update.
However, it returns the wrong docs for the fields of nested structs.
To fix this we need to visit all fields recursively.

The second one is not a generic declaration. So, the simplest solution
is to use the method Snapshot.PosToField.

Fixes golang/go#43675

Change-Id: I46685e7985cbf2c1c5b1b74ef3cd3a70b920feba
GitHub-Last-Rev: 8a5704c2ecc3f8a007c00c7adcd637e56d99106c
GitHub-Pull-Request: golang/tools#284
Reviewed-on: https://go-review.googlesource.com/c/tools/+/300029
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-03-30 03:09:04 +00:00
..
completion internal/lsp/source: fix docs for fields of anonymous structs/interfaces 2021-03-30 03:09:04 +00:00
api_json.go internal/lsp/completion: move postfix completions behind option 2021-03-29 18:55:49 +00:00
call_hierarchy.go internal/lsp/source: return all field funcs from outgoing callhierarchy 2021-01-05 17:25:16 +00:00
code_lens.go internal/lsp: switch to the new command API 2021-02-09 22:09:28 +00:00
comment.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
comment_test.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
diagnostics.go internal/lsp: fix support for SourceFixAll code actions 2021-03-24 23:51:27 +00:00
extract.go internal/lsp/source: skip blank identifiers during the function extraction 2021-03-29 19:56:10 +00:00
fix.go internal/lsp: fix support for SourceFixAll code actions 2021-03-24 23:51:27 +00:00
folding_range.go internal/lsp/source: return nil for foldingRange in case of parse error 2021-03-08 17:39:28 +00:00
format.go internal/lsp, gopls: recover from go-diff panics 2020-12-17 16:56:54 +00:00
format_test.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
gc_annotations.go internal/lsp: key GC details off package ID 2021-03-02 22:01:38 +00:00
highlight.go internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
hover.go internal/lsp/source: fix docs for fields of anonymous structs/interfaces 2021-03-30 03:09:04 +00:00
identifier.go internal/lsp: handle nil pointer with import shortcut = link 2021-02-16 20:35:08 +00:00
identifier_test.go internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
implementation.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
options.go internal/lsp/completion: move postfix completions behind option 2021-03-29 18:55:49 +00:00
options_test.go internal/lsp: restructure user options (CL 278433 continued) 2020-12-30 21:54:22 +00:00
references.go internal/lsp/source: rename uses of embedded fields 2021-01-12 21:27:35 +00:00
rename.go internal/lsp/source: make it an error to rename embedded fields 2021-01-26 13:52:46 +00:00
rename_check.go internal/lsp/source: eliminate GetTypeCheckDiagnostics 2021-03-03 21:21:28 +00:00
signature_help.go internal/lsp/source: fix docs for fields of anonymous structs/interfaces 2021-03-30 03:09:04 +00:00
source_test.go internal/lsp/completion: move postfix completions behind option 2021-03-29 18:55:49 +00:00
symbols.go internal/lsp: don't show blank identifiers in outline 2020-10-09 01:09:51 +00:00
types_format.go internal/lsp/source: fix default param name generation 2020-12-07 19:19:02 +00:00
util.go internal/lsp/source: fix hover and completion with dot imports 2021-03-25 00:32:48 +00:00
view.go internal/lsp: fix support for SourceFixAll code actions 2021-03-24 23:51:27 +00:00
workspace_symbol.go internal/lsp/source: correct workspace symbol logic for unpacking receivers 2021-03-05 19:21:50 +00:00
workspace_symbol_test.go internal/lsp/source: support some fzf-like tokens in symbol matching 2020-09-08 16:35:05 +00:00