mirror of
https://github.com/golang/go
synced 2024-11-19 05:14:50 -07:00
7bd96bd597
If the enclosing value spec specifies a type on the LHS, we now prefer completions of that type on the RHS. For example: i := 123 var foo int = // prefer "i" since we know we want an int I also added a special case to lexical() to know that we can't offer objects defined on the LHS as completions on the RHS. For example: var foo int = // don't offer "foo" as completion Change-Id: I8e24245a2bc86a29887360e7f642a4cbb87fa6ca Reviewed-on: https://go-review.googlesource.com/c/tools/+/212401 Run-TryBot: Muir Manders <muir@mnd.rs> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
16 lines
314 B
Go
16 lines
314 B
Go
package assign
|
|
|
|
func _() {
|
|
var (
|
|
myInt int //@item(assignInt, "myInt", "int", "var")
|
|
myStr string //@item(assignStr, "myStr", "string", "var")
|
|
)
|
|
|
|
var _ string = my //@rank(" //", assignStr, assignInt)
|
|
var _ string = //@rank(" //", assignStr, assignInt)
|
|
}
|
|
|
|
func _() {
|
|
var a string = a //@complete(" //")
|
|
}
|