go/internal/lsp/cache
Robert Findley 0d04f65da9 internal/lsp: re-send diagnostics on file events
Fix golang/go#50267 by ensuring that diagnostics are re-sent following
didOpen or didClose events. Additionally, introduce a new hidden
'chattyDiagnostics' option that causes diagnostics to be resent on
*every* file change event. This latter option is for LSP clients that
get confused when diagnostics are not re-sent for later file versions.
For now, be conservative and only force diagnostic publication on
didOpen and didClose.

Update tests whose 'NoDiagnostics' assertions were broken by the new
behavior.

Fixes golang/go#50267

Change-Id: I6332d66a1851e0d8261599d37020a03b4c598f7d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/420539
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-08-02 18:52:36 +00:00
..
analysis.go internal/lsp/cache: delete workspacePackageHandles (dead code) 2022-07-15 14:53:26 +00:00
cache.go internal/lsp/regtest: allow sharing memoized results across regtests 2022-07-26 21:20:42 +00:00
check.go internal/lsp/regtest: allow sharing memoized results across regtests 2022-07-26 21:20:42 +00:00
debug.go internal/lsp/cache: build a new metadata graph on load 2022-06-16 15:50:09 +00:00
error_test.go internal/lsp/cache: split up sourceDiagnostics 2021-03-02 02:05:13 +00:00
errors.go internal/span: make NewRange accept File, not FileSet 2022-07-06 19:40:50 +00:00
graph.go internal/lsp/cache: use GetHandle not Bind in astCacheData 2022-07-07 02:48:48 +00:00
imports.go internal/lsp/cache: use mod=readonly for process env funcs 2022-07-12 14:39:19 +00:00
keys.go internal/lsp: decouple client and server debug 2020-06-11 13:49:48 +00:00
load.go internal/lsp/cache: report a critical error when go.work is invalid 2022-07-27 18:59:40 +00:00
maps.go internal/lsp/cache: simplify modtidy 2022-07-13 19:33:07 +00:00
metadata.go gopls/internal/regtest: externalize shouldLoad tracking 2022-07-22 21:31:20 +00:00
mod.go internal/memoize: rename Handle to Promise 2022-07-14 01:47:39 +00:00
mod_tidy.go internal/lsp/cache: report a critical error when go.work is invalid 2022-07-27 18:59:40 +00:00
os_darwin.go internal/lsp/cache: clarify an error message about mismatching casing 2021-08-03 17:18:10 +00:00
os_windows.go internal/lsp/cache: clarify an error message about mismatching casing 2021-08-03 17:18:10 +00:00
parse.go internal/memoize: rename Handle to Promise 2022-07-14 01:47:39 +00:00
parse_test.go internal/lsp/cache: don't trim unexported struct fields 2022-07-13 21:08:41 +00:00
parsemode_go116.go internal/lsp/cache: use cached parsed files for symbols, if available 2022-05-09 17:04:06 +00:00
parsemode_go117.go internal/lsp/cache: use cached parsed files for symbols, if available 2022-05-09 17:04:06 +00:00
pkg.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
session.go internal/lsp: re-send diagnostics on file events 2022-08-02 18:52:36 +00:00
snapshot.go internal/lsp/cache: simplify snapshot.Clone reinitialization logic 2022-07-27 19:27:52 +00:00
symbols.go internal/memoize: rename Handle to Promise 2022-07-14 01:47:39 +00:00
view.go internal/lsp/cache: don't set context cancellation as a critical err 2022-07-29 15:25:28 +00:00
view_test.go internal/lsp: Update FilterDisallow to support matching directories at arbitrary depth. 2022-07-18 17:53:36 +00:00
workspace.go internal/lsp/cache: simplify snapshot.Clone reinitialization logic 2022-07-27 19:27:52 +00:00
workspace_test.go internal/lsp/cache: simplify snapshot.Clone reinitialization logic 2022-07-27 19:27:52 +00:00