| commit | 0941294088d129f9e8931c1371f1aac9b7fa58da | [log] [tgz] |
|---|---|---|
| author | Muir Manders <muir@mnd.rs> | Thu Apr 14 21:30:13 2022 -0700 |
| committer | Robert Findley <rfindley@google.com> | Tue Apr 26 02:29:50 2022 +0000 |
| tree | e63e914146ea94532ae04727c896e7b745535fc8 | |
| parent | c9035635c7bd70314c1e94a662aa5ae6937cc430 [diff] |
lsp/completion: further improve generic func arg ranking
In cases like:
func foo[T int | string](T) {}
foo[int](<>)
Previously at <> we would favor int and string candidates. This is
because go/types doesn't instantiate foo in this case (for some
reason). Work around the issue by using types.CheckExpr to re-check
the *ast.CallExpr.Fun. CheckExpr seems to do a better than a full type
check in the face of errors.
Updates golang/go#52291
Updates golang/go#52503
Change-Id: Ide436428f3232db2e06ea3cc22ea250edbf28685
Reviewed-on: https://go-review.googlesource.com/c/tools/+/400614
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This subrepository holds the source for various packages and tools that support the Go programming language.
Some of the tools, godoc and vet for example, are included in binary Go distributions.
Others, including the Go guru and the test coverage tool, can be fetched with go install.
Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.
The easiest way to install is to run go install golang.org/x/tools/...@latest.
This repository uses prettier to format JS and CSS files.
The version of prettier used is 1.18.2.
It is encouraged that all JS and CSS code be run through this before submitting a change. However, it is not a strict requirement enforced by CI.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.