1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00
go/internal
Muir Manders 50d618665b internal/lsp/source: improve completion involving multiple return values
For example:

// Prefer functions that return one or two values. Previously
// we had no preference.
foo, bar := <>

// Prefer functions that return "(int)" or "(int, ??)". Previously we
// only preferred the former.
var foo int
foo, bar := <>

// Prefer functions that return "(int)" or "(int, int)". Previously we
// only preferred the former.
var foo func(int, int)
foo(<>)

In the above example, we don't handle "foo" being variadic yet.

I also took the liberty to break up matchingCandidate() into separate
functions since it was getting rather long.

Updates golang/go#36540.

Change-Id: I9140dd989dfde1ddcfcd9d2a14198045c02587f2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/215537
Run-TryBot: Muir Manders <muir@mnd.rs>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-02-06 05:07:08 +00:00
..
apidiff all: fix more typos 2019-09-11 15:13:14 +00:00
fastwalk all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
gopathwalk all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
imports internal/imports: prevent self-imports in the stdlib 2020-02-06 00:08:43 +00:00
jsonrpc2 internal/jsonrpc2: fix invalid invocations of Fatalf in goroutines 2020-02-05 19:51:38 +00:00
lsp internal/lsp/source: improve completion involving multiple return values 2020-02-06 05:07:08 +00:00
memoize internal/lsp/debug: serve cache entry counts 2020-02-03 22:21:18 +00:00
module imports: stop using go/packages for modules 2019-01-22 20:29:12 +00:00
packagesinternal go/packages: internally expose ForTests in go/packages 2020-01-16 22:11:50 +00:00
semver go/packages: add name= query 2018-10-16 20:20:09 +00:00
span internal/span, internal/lsp: fix URI escaping 2020-02-04 00:54:49 +00:00
telemetry all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
testenv internal/testenv: reject the resolved 'go' command if it does not match runtime.GOROOT 2019-11-11 19:22:22 +00:00
tool internal/lsp, internal/tool: clean up command line of gopls 2019-12-16 17:36:52 +00:00
xcontext internal/lsp: stop making background contexts everywhere 2019-07-11 16:38:52 +00:00