Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: prefer modules in `go.mod` when importing or ranking completion items #38461
go version: 1.14
When there are multiple matching packages with similar APIs (e.g. v1 vs v2)
Let's assume an incomplete go file:
When only one version exists in the module cache, everything works fine.
Let's add the version 1 in the module cache, but leave the original go.mod file untouched.
Same idea can apply to the auto-completion. In the below image, the completion item lists include candidates from both v1 and v2. The VS Code UI is not great at telling where the candidate is from. The first