1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:48:32 -06:00
go/internal/lsp/cache
Muir Manders 63f37bb4d3 internal/lsp: fix some cases of stuck files
If typeCheck() returned an error, we could get into a state where a
package had an entry in the pcache, but the package's files had an
empty "pkgs" map. When we got a DidChange event for one of the files,
no packages would get invalidated since the file's "pkgs" was
empty. This resulted in the cached typeCheck() error persisting
indefinitely. Fix by never caching pcache entries on error.

An easy way to reproduce the problem was to delete the package name
from a file. For example, edit "package foo" to be just
"package". This caused the package to get stuck with an "AST for %s
has an invalid position" error.

Change-Id: I330bf9e419852dffa0f2dee94b56226367488dd1
GitHub-Last-Rev: 18be7078521b942694c76f799a2d520eee47167d
GitHub-Pull-Request: golang/tools#135
Reviewed-on: https://go-review.googlesource.com/c/tools/+/185839
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
2019-07-12 18:43:07 +00:00
..
cache.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
check.go internal/lsp: fix some cases of stuck files 2019-07-12 18:43:07 +00:00
external.go internal/lsp: reduce trace package to minimal StartSpan for now 2019-07-11 17:25:55 +00:00
file.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
gofile.go internal/lsp: fix bug where gopls hangs on manually typed imports 2019-07-01 17:55:09 +00:00
load.go internal/lsp: don't refresh metadata when context canceled 2019-07-09 18:24:20 +00:00
modfile.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
parse.go internal/lsp: reduce trace package to minimal StartSpan for now 2019-07-11 17:25:55 +00:00
pkg.go internal/lsp: plumb suggested fixes through the LSP 2019-06-26 21:02:18 +00:00
session.go internal/lsp: stop making background contexts everywhere 2019-07-11 16:38:52 +00:00
sumfile.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
token.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
view.go internal/lsp: fix deadlocks loading lots of files at once 2019-07-03 17:22:52 +00:00
watcher.go internal/lsp: fix deadlocks loading lots of files at once 2019-07-03 17:22:52 +00:00