mirror of
https://github.com/golang/go
synced 2024-11-18 21:14:44 -07:00
1d0142ba47
If the context is canceled (or times out) during parsing, we were previously caching the package with no *ast.Files. Any further LSP queries against that package would fail because the package is already loaded, but none of the files are mapped to the package. Fix by propagating non-parse errors as "fatal" errors in parseFiles. typeCheck will propagate these errors and not cache the package. I also fixed the package cache to not cache errors loading packages. If you get an error like "context canceled" then none of the package's files are mapped to the package. This prevents the package from ever getting unmapped when its files are updated. I also added a retry mechanism where if the current request is not canceled but the package failed to load due to a previous request being canceled, this request can try loading the package again. Updates golang/go#32354, golang/go#32360 Change-Id: I466ddb8d336aeecf6e50f9f6d040787a86a60ca0 GitHub-Last-Rev: 5f1e7ef9c883b76a9c1b3636936d91ec0821d922 GitHub-Pull-Request: golang/tools#110 Reviewed-on: https://go-review.googlesource.com/c/tools/+/181317 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> |
||
---|---|---|
.. | ||
cache.go | ||
check.go | ||
external.go | ||
file.go | ||
gofile.go | ||
load.go | ||
modfile.go | ||
parse.go | ||
pkg.go | ||
session.go | ||
sumfile.go | ||
view.go | ||
watcher.go |