1
0
mirror of https://github.com/golang/go synced 2024-10-01 13:08:32 -06:00
Commit Graph

54 Commits

Author SHA1 Message Date
Muir Manders
02335f11d5 internal/lsp: don't qualify literal candidates in *ast.SelectorExpr
Previously we unconditionally qualified literal candidate types with
their package. For example:

var buf *bytes.Buffer
buf = &bytes.Bu<>

would complete to:

buf = &bytes.bytes.Buffer{}

Now we don't qualify the type if the cursor position is in the
selector of an *ast.SelectorExpr. We only generate literal candidates
for type names, so if we are in a selector then we can assume it is a
package qualified type (as opposed to an object field).

We also handle the insertion of "&" for literal pointers better. If you are in
the selector of an *ast.SelectorExpr, we prepend the "&" to the beginning of the
expression rather than the selector. For example, you will end up with
"&bytes.Buffer{}" instead of "bytes.&Buffer{}".

Updates golang/go#34872.

Change-Id: I812aa809cd4e649a429853386789f80033412814
Reviewed-on: https://go-review.googlesource.com/c/tools/+/201200
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-16 23:29:27 +00:00
Muir Manders
5bac78f585 internal/lsp: add label completion candidates
Now we offer completion candidates for labels when completing "break",
"continue", and "goto" statements. We are reasonably smart about
filtering unusable labels, except we don't filter "goto" candidates
that jump across variable definitions.

Fixes golang/go#33987.

Change-Id: If296a7579845aba5d86c7050ab195c35d4b147ed
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197417
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-16 23:06:01 +00:00
Rebecca Stambler
e461004dd0 internal/lsp: add constant values to hovers
Change-Id: Ic0c497f4b1644f915db850be3fbacda8e2f85e9a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197818
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-09-28 23:04:22 +00:00
Ian Cottrell
69890759d9 use a golden file for the expected test counts
This makes it much easier to keep them up to date.
It is also less fragile against accidental changes.

Change-Id: If119f8527c0896d210650859960e77f3e0fa5a99
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197505
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-09-27 05:27:46 +00:00