go/internal/lsp/cmd
Karthik Nayak d25f906682 internal/lsp: do not block on channel when there is an error
In `internal/lsp/cmd.(*connection).diagnoseFiles`, when we request for
`gopls/diagnoseFiles`, we are blocked on the channel even if there is an error.
In such a scenario, we've reach a deadlock since. Avoid this by checking for
error, existing if it exists and also closing the channel while we're at it.

Fixes golang/go#46251

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>

Change-Id: I4266ab3ac272a9ae3eac2084b70b6568b72c1984
GitHub-Last-Rev: 94bf2926a0f35d51d62643618a8072ef5a8b5225
GitHub-Pull-Request: golang/tools#324
Reviewed-on: https://go-review.googlesource.com/c/tools/+/329109
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-18 18:34:00 +00:00
..
test internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
call_hierarchy.go internal/lsp/cmd: improve help output of gopls subcommands 2021-01-25 18:56:18 +00:00
capabilities_test.go internal/lsp: remove some unused parameters, mostly in the cache package 2021-03-25 00:26:08 +00:00
check.go internal/lsp/cmd: improve help output of gopls subcommands 2021-01-25 18:56:18 +00:00
cmd.go internal/lsp: do not block on channel when there is an error 2021-06-18 18:34:00 +00:00
cmd_test.go internal/lsp/cmd: delete TestDefinitionHelpExample test 2020-11-03 23:54:15 +00:00
definition.go internal/lsp/cmd: fix the command line query for definition 2020-04-27 20:15:23 +00:00
export_test.go
folding_range.go internal/span,lsp: disambiguate URIs, DocumentURIs, and paths 2020-02-14 22:51:03 +00:00
format.go internal/lsp: address staticcheck warnings 2019-10-04 02:16:23 +00:00
highlight.go internal/lsp/cmd: improve help output of gopls subcommands 2021-01-25 18:56:18 +00:00
implementation.go internal/lsp/cmd: improve help output of gopls subcommands 2021-01-25 18:56:18 +00:00
imports.go internal/lsp: check for file URIs on LSP requests 2020-02-14 22:51:26 +00:00
info.go internal/lsp: move the progress tracker to the session 2021-06-16 01:01:29 +00:00
links.go internal/span,lsp: disambiguate URIs, DocumentURIs, and paths 2020-02-14 22:51:03 +00:00
prepare_rename.go internal/lsp/cmd: improve help output of gopls subcommands 2021-01-25 18:56:18 +00:00
references.go internal/lsp: check for file URIs on LSP requests 2020-02-14 22:51:26 +00:00
remote.go internal/lsp/cmd: add a command-line command to start daemon debugging 2021-04-27 13:49:53 +00:00
rename.go internal/lsp/cmd: include new name in rename help message 2020-12-28 17:52:27 +00:00
semantictokens.go internal/lsp/semantic: avoid doing semantic tokens for large files 2021-04-20 17:53:17 +00:00
serve.go internal/lsp/cmd: add a command-line command to start daemon debugging 2021-04-27 13:49:53 +00:00
signature.go internal/lsp/cmd: improve help output of gopls subcommands 2021-01-25 18:56:18 +00:00
subcommands.go internal/lsp/cmd: add a command-line command to start daemon debugging 2021-04-27 13:49:53 +00:00
suggested_fix.go internal/lsp: move undeclaredname suggested fix out of analysis 2020-07-23 23:54:27 +00:00
symbols.go internal/lsp/cmd: fix not displaying symbols result 2020-05-11 23:26:04 +00:00
workspace.go internal/lsp/cmd: add a command-line command to start daemon debugging 2021-04-27 13:49:53 +00:00
workspace_symbol.go internal/lsp: add config option for SymbolMatch 2020-05-11 19:58:58 +00:00