1
0
mirror of https://github.com/golang/go synced 2024-11-18 06:14:46 -07:00

internal/lsp/source: remove dead code from completion

This code seems to be duplicate of L509-L522 in this CL. It doesn't
affect the results of completion in any way since we already return
early from where we can.

Change-Id: I30ee1c94e58860f86d773d46cb1e527b2e646ef4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/251261
Run-TryBot: Danish Dua <danishdua@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Danish Dua 2020-08-27 21:05:18 -04:00
parent 3c805d2368
commit 97019fc2e6

View File

@ -620,19 +620,6 @@ func Completion(ctx context.Context, snapshot Snapshot, fh FileHandle, protoPos
if err := c.selector(ctx, sel); err != nil {
return nil, nil, err
}
} else if obj, ok := pkg.GetTypesInfo().Defs[n]; ok {
// reject defining identifiers
if v, ok := obj.(*types.Var); ok && v.IsField() && v.Embedded() {
// An anonymous field is also a reference to a type.
} else {
objStr := ""
if obj != nil {
qual := types.RelativeTo(pkg.GetTypes())
objStr = types.ObjectString(obj, qual)
}
return nil, nil, ErrIsDefinition{objStr: objStr}
}
} else if err := c.lexical(ctx); err != nil {
return nil, nil, err
}