go/gopls/internal/regtest/diagnostics
Heschi Kreinick c0b9fb59f7 internal/lsp/analysis/undeclaredname: suppress impossible quick fixes
Reading the code and running the tests, it appears we only support quick
fixes for undeclared name errors inside function bodies. Don't offer
them in other places.

The specific situation raised was type constraints, so that's what I
tested even though the problem was much broader. Also add actual error
messages where we had empty strings.

Fixes golang/go#50935.

Change-Id: I8dadcb6e4301bf22cbe7fe5d66064aafeef02690
Reviewed-on: https://go-review.googlesource.com/c/tools/+/384117
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-09 19:35:26 +00:00
..
builtin_test.go internal/lsp: don't call PackagesForFile on builtin.go 2021-04-29 13:06:21 +00:00
diagnostics_test.go internal/lsp/analysis/undeclaredname: suppress impossible quick fixes 2022-02-09 19:35:26 +00:00
undeclared_test.go internal/lsp/cache: fix incorrect detection of useless code 2021-10-14 14:04:14 +00:00