mirror of
https://github.com/golang/go
synced 2024-11-18 20:24:41 -07:00
internal/lsp: avoid unnecessary type checking
Previously we would type check all package handles as we fetched them. This meant if you only cared about a file's primary package you would still have to wait for all its packages to be type checked. For example, when completing in foo.go, you would wait for [foo.go] and [foo.go, foo_test.go] to be checked (the latter being the test variant). Now we don't type check packages as we put together the package handles. Change-Id: Ibca0c6b34cf4f0a07bcdeb62959d60158f4ccf17 Reviewed-on: https://go-review.googlesource.com/c/tools/+/195417 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
3512ebf574
commit
b31ee645dd
4
internal/lsp/cache/load.go
vendored
4
internal/lsp/cache/load.go
vendored
@ -38,10 +38,6 @@ func (view *view) loadParseTypecheck(ctx context.Context, f *goFile, fh source.F
|
||||
log.Error(ctx, "loadParseTypeCheck: failed to get CheckPackageHandle", err, telemetry.Package.Of(m.id))
|
||||
continue
|
||||
}
|
||||
if _, err := cph.check(ctx); err != nil {
|
||||
log.Error(ctx, "loadParseTypeCheck: failed to check package", err, telemetry.Package.Of(m.id))
|
||||
continue
|
||||
}
|
||||
// Cache this package on the file object, since all dependencies are cached in the Import function.
|
||||
if err := imp.cachePackage(ctx, cph); err != nil {
|
||||
log.Error(ctx, "loadParseTypeCheck: failed to cache package", err, telemetry.Package.Of(m.id))
|
||||
|
Loading…
Reference in New Issue
Block a user