File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
internal/lsp/source/completion Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1264,6 +1264,11 @@ func (c *completer) lexical(ctx context.Context) error {
1264
1264
var (
1265
1265
builtinIota = types .Universe .Lookup ("iota" )
1266
1266
builtinNil = types .Universe .Lookup ("nil" )
1267
+ // comparable is an interface that exists on the dev.typeparams Go branch.
1268
+ // Filter it out from completion results to stabilize tests.
1269
+ // TODO(rFindley) update (or remove) our handling for comparable once the
1270
+ // type parameter API has stabilized.
1271
+ builtinComparable = types .Universe .Lookup ("comparable" )
1267
1272
)
1268
1273
1269
1274
// Track seen variables to avoid showing completions for shadowed variables.
@@ -1282,6 +1287,9 @@ func (c *completer) lexical(ctx context.Context) error {
1282
1287
if declScope != scope {
1283
1288
continue // Name was declared in some enclosing scope, or not at all.
1284
1289
}
1290
+ if obj == builtinComparable {
1291
+ continue
1292
+ }
1285
1293
1286
1294
// If obj's type is invalid, find the AST node that defines the lexical block
1287
1295
// containing the declaration of obj. Don't resolve types for packages.
You can’t perform that action at this time.
0 commit comments