gopls/internal/golang/completion: report types in unimported completion - #677
gopls/internal/golang/completion: report types in unimported completion#677efrem0ff wants to merge 1 commit into
Conversation
ab59b40 to
756ed79
Compare
|
This PR (HEAD: 756ed79) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/828104. Important tips:
|
pkgIDmatches handled only the Function, Variable, Struct and Constant symbol kinds, so an interface or a named non-struct type from a workspace package was dropped, and a struct type was reported as "var". Report every type as "type (from ...)", as the other two search paths already do. All three paths gave a type VariableCompletion, so editors drew a variable icon beside an item whose detail read "type". Use InterfaceCompletion for an interface and ClassCompletion otherwise. The standard library and module cache indexes do not record whether a type is an interface, so those two paths always use ClassCompletion. Fixes golang/go#81369
756ed79 to
e64f1ef
Compare
|
This PR (HEAD: e64f1ef) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/828104. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/828104. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/828104. |
|
Message from Sergei Efremov: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/828104. |
pkgIDmatches handled only the Function, Variable, Struct and Constant symbol
kinds, so an interface or a named non-struct type from a workspace package
was dropped, and a struct type was reported as "var". Report every type as
"type (from ...)", as the other two search paths already do.
All three paths gave a type VariableCompletion, so editors drew a variable
icon beside an item whose detail read "type". Use InterfaceCompletion for an
interface and ClassCompletion otherwise. The standard library and module
cache indexes do not record whether a type is an interface, so those two
paths always use ClassCompletion.
Fixes golang/go#81369