1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:14:50 -07:00
go/internal/lsp/testdata/builtins/constants.go
Muir Manders a222fb47e2 internal/lsp/source: don't downrank builtin constant completions
We downrank untyped constant candidates so that we prefer candidates
whose type matches exactly. However, this was causing builtin
constants like "true" to be outranked by candidates that fuzzily match
"true". Fix by not downranking builtin constants.

Fixes golang/go#36363.

Change-Id: I14801688c96efdbb7ff9fee69f66028530df984c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/213137
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-07 18:15:58 +00:00

20 lines
330 B
Go

package builtins
func _() {
const (
foo = iota //@complete(" //", iota)
)
iota //@complete(" //")
var iota int //@item(iotaVar, "iota", "int", "var")
iota //@complete(" //", iotaVar)
}
func _() {
var twoRedUpEnd bool //@item(TRUEVar, "twoRedUpEnd", "bool", "var")
var _ bool = true //@rank(" //", _true, TRUEVar)
}