1
0
mirror of https://github.com/golang/go synced 2024-11-18 21:05:02 -07:00
go/internal/lsp
Muir Manders e54115a062 internal/lsp: fix stuck diagnostic messages
The "analyses" cache in lsp/cache.(*Package).GetActionGraph was not
getting cleared on errors. This could result in future calls to
GetActionGraph waiting on the "ready" channel indefinitely. This in
turn caused the goroutine in cacheAndDiagnose to block indefinitely
and never send the diagnostic results back.

Now we use a defer statement to always close the channel. If we did
not succeed, we also clear out the cache entry and set a "succeeded =
false" flag to signal waiters that they need to retry. If in the
future errors other than context.Canceled/Timeout are possible, this
retry behavior may need to be revisited.

Fixes golang/go#30786

Change-Id: Icacc9188f1500b00f2178521ce373a2c1363f932
GitHub-Last-Rev: 7c43afd4286a69b0d35a625716e6934c72c4cef5
GitHub-Pull-Request: golang/tools#91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/173977
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
2019-04-25 21:19:06 +00:00
..
cache internal/lsp: fix stuck diagnostic messages 2019-04-25 21:19:06 +00:00
cmd internal/lsp: fix error handling in cmd 2019-04-22 18:06:12 +00:00
diff internal/lsp: normalise and make public diff<->edit conversions 2019-04-15 20:31:36 +00:00
protocol internal/lsp: fix typo on 'textDocument/foldingRange' method 2019-04-22 18:44:13 +00:00
snippet internal/lsp: introduce snippet builder object 2019-04-25 18:37:29 +00:00
source internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
testdata internal/lsp: handle completion after defer, go statements 2019-04-24 22:01:01 +00:00
tests internal/lsp: handle completion after defer, go statements 2019-04-24 22:01:01 +00:00
xlog internal/lsp: add the ability to log back to the client 2019-04-01 16:22:08 +00:00
code_action.go internal/lsp: run source.organizeImports on all codeActions 2019-04-16 21:54:00 +00:00
completion.go internal/lsp: add type to placeholders in completion parameters 2019-04-19 19:58:23 +00:00
definition.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
diagnostics.go internal/lsp: add more error propagation and logging for analyses 2019-04-24 02:44:48 +00:00
format.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
general.go internal/lsp: use ast.Nodes for hover information 2019-04-18 23:52:43 +00:00
highlight.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
hover.go internal/lsp: support comments on hover for typenames, funcs, fields 2019-04-22 16:38:38 +00:00
lsp_test.go internal/lsp: improve composite literal completion 2019-04-23 22:28:03 +00:00
server.go internal/lsp: fix typo on 'textDocument/foldingRange' method 2019-04-22 18:44:13 +00:00
signature_help.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
symbols.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
text_synchronization.go internal/lsp: add additional debug logging for diagnostics 2019-04-22 21:11:31 +00:00
util.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00