1
0
mirror of https://github.com/golang/go synced 2024-10-01 13:28:37 -06:00
go/internal/lsp/cache
Muir Manders 5e3480f0e0 internal/lsp: start handling watched file deletes
Now when a file is deleted we force the file's packages to refresh
go/packages metadata, and kick off diagnostics.

I made a couple other changes to watched file handling:
- Kick off diagnostics in a goroutine to match how DidChange works.
  This will allow us to work through big sets of file changes faster,
  and will save duplicated work once type checking can be canceled.
- Don't assume a watched file is only part of one view.

Two interesting cases we don't handle yet:
- If the deleted file was the only file in the package, we don't
  currently update diagnostics for dependent packages. This requires
  rejiggering how diagnostics are invoked a bit.
- If the deleted file is still open in the editor and then later
  closed, we don't trigger metadata/diagnostics refresh on DidClose.

Updates golang/go#31553

Change-Id: I65768614c24d9800ffea149ccdbdbd3cb7b2f3d8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/193121
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-09-10 20:08:16 +00:00
..
cache.go internal/lsp: move configuration options to structs 2019-09-06 17:30:54 +00:00
check.go internal/lsp/cache: detail why the err is ignored 2019-09-06 20:38:14 +00:00
external.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
file.go internal/lsp: fix deadlock in type-checking 2019-09-05 03:50:54 +00:00
gofile.go internal/lsp: remove the GetToken and GetAST functions 2019-09-09 18:10:35 +00:00
load.go internal/lsp: start handling watched file deletes 2019-09-10 20:08:16 +00:00
modfile.go internal/lsp: use x/xerrors to create new errors 2019-08-06 19:46:56 +00:00
parse.go internal/lsp: fix completion for nested *ast.BadStmt 2019-09-10 16:55:22 +00:00
pkg.go internal/lsp: derive ASTs from type information 2019-09-10 13:53:09 +00:00
session.go internal/lsp: start handling watched file deletes 2019-09-10 20:08:16 +00:00
sumfile.go internal/lsp: use x/xerrors to create new errors 2019-08-06 19:46:56 +00:00
token.go internal/lsp: unlabel context, log errors when canceled 2019-08-20 20:39:21 +00:00
view.go internal/lsp: start handling watched file deletes 2019-09-10 20:08:16 +00:00
watcher.go internal/lsp: fix deadlocks loading lots of files at once 2019-07-03 17:22:52 +00:00