1
0
mirror of https://github.com/golang/go synced 2024-11-05 14:56:10 -07:00

internal/lsp/cache: remove errors from dependencies

Now that `go list` errors are sufficient for us to determine a circular
dependency, we don't need to cache errors on dependency packages.

Change-Id: I0633aeb356f93d21afed3371d61d7eae7de255ac
Reviewed-on: https://go-review.googlesource.com/c/tools/+/212197
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rohan Challa <rohan@golang.org>
Reviewed-by: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Rebecca Stambler 2019-12-19 16:07:18 -05:00
parent 85a3356613
commit 041a08a54a

View File

@ -330,13 +330,16 @@ func typeCheck(ctx context.Context, fset *token.FileSet, m *metadata, mode sourc
return nil, ctx.Err()
}
for _, e := range rawErrors {
srcErr, err := sourceError(ctx, fset, pkg, e)
if err != nil {
log.Error(ctx, "unable to compute error positions", err, telemetry.Package.Of(pkg.ID()))
continue
// We don't care about a package's errors unless we have parsed it in full.
if mode == source.ParseFull {
for _, e := range rawErrors {
srcErr, err := sourceError(ctx, fset, pkg, e)
if err != nil {
log.Error(ctx, "unable to compute error positions", err, telemetry.Package.Of(pkg.ID()))
continue
}
pkg.errors = append(pkg.errors, srcErr)
}
pkg.errors = append(pkg.errors, srcErr)
}
return pkg, nil
}