Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: normalize feature sets of unimported completions and organize imports #36077
What version of Go are you using (
As a followup to CL 204203, prefer direct dependencies over indirect. This should improve results for common names like "log" and "errors". Updates golang/go#36077. Change-Id: I3f8cfa070832c2035aec60c4e583ee1c0abf5085 Reviewed-on: https://go-review.googlesource.com/c/tools/+/212021 Run-TryBot: Heschi Kreinick <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Rebecca Stambler <email@example.com>
Retitling to reflect the remaining work.
Unimported completions are missing the "sibling imports" trick. This would be a nice feature. I'm not sure whether to reuse the implementation from the imports package or rewrite it from scratch. Sharing code would be nice, but gopls already has all the parsing done. Just pass all the sibling files to GetPackageExports?
Organize Imports is missing the sorting by relevance. This should be easy to plug in to addExternalCandidates, as long as we want it to affect goimports. Sibling imports will take precedence, but that's probably appropriate.