go/gopls/internal/regtest/misc
Robert Findley e1ec1f3230 internal/imports: use a module resolver if GOWORK is set
Previously, gopls would fall back on a gopath resolver when running
goimports from a directory containing go.work (but not go.mod). Fix this
by update the code to recognize that GOWORK also puts goimports into
module mode.

All the work to _support_ go.work had already been done, but the tests
were only passing because they were setting GO111MODULE=on explicitly
(and therefore GOMOD=/dev/null was satisfying the pre-existing check).

Also add a test for the regression in gopls.

Fixes golang/go#52784

Change-Id: I31df6f71a949a5668e8dc001b3ee25ad26f2f927
Reviewed-on: https://go-review.googlesource.com/c/tools/+/413689
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2022-06-24 21:03:09 +00:00
..
call_hierarchy_test.go internal/lsp/source: check for nil objects in call hierarchy 2021-10-27 16:11:50 +00:00
configuration_test.go gopls: upgrade staticcheck to v0.3.0 2022-04-07 14:59:24 +00:00
debugserver_test.go internal/lsp/debug: add a facility to track known bugs 2021-05-10 23:21:19 +00:00
definition_test.go internal/lsp: check for invalid URIs in definition 2021-10-29 19:33:54 +00:00
embed_test.go internal/lsp/cache: parse files with ParseFull mode to check if metadata reload is required 2021-08-06 19:38:52 +00:00
failures_test.go internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +00:00
fix_test.go internal/lsp/analysis/fillreturns: update fillreturns for new type errs 2021-12-03 18:55:02 +00:00
formatting_test.go gopls: wire in LangVersion and ModulePath for gofumpt formatting 2022-02-24 18:08:50 +00:00
generate_test.go gopls/internal/regtest/misc: temporarily skip TestGenerateProgress 2021-12-01 18:47:44 +00:00
highlight_test.go internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +00:00
hover_test.go internal/lsp: render package documentation when hovering over a package import 2022-04-25 17:29:41 +00:00
import_test.go internal/lsp: add ListImports 2022-02-04 22:09:29 +00:00
imports_test.go internal/imports: use a module resolver if GOWORK is set 2022-06-24 21:03:09 +00:00
link_test.go internal/lsp: only linkify urls with http, https, and ftp schemes 2022-05-02 22:00:12 +00:00
misc_test.go internal/lsp/cache: invalidate metadata when parsing issues resolve 2022-05-23 18:14:40 +00:00
multiple_adhoc_test.go internal/lsp: allow for multiple ad-hoc packages in the workspace 2021-08-12 18:45:58 +00:00
references_test.go internal/lsp: find references to package 2022-06-21 19:39:47 +00:00
rename_test.go internal/lsp/source: recursively search for qualified objects 2021-08-17 02:54:26 +00:00
semantictokens_test.go internal/lsp: get file URI from beginFileRequest in SemanticTokens 2021-05-12 22:01:29 +00:00
settings_test.go internal/lsp/source: handle empty strings in directoryFilters 2022-03-24 21:16:24 +00:00
shared_test.go internal/lsp/regtest: don't run the connection on the test context 2022-06-10 12:48:42 +00:00
staticcheck_test.go gopls/internal/regtest: add a test for using staticcheck with generics 2022-05-11 20:19:40 +00:00
vendor_test.go internal/lsp: run go mod vendor exclusively to avoid file contention 2022-04-11 22:06:59 +00:00
vuln_test.go internal/lsp: handle invalid URL args in command params 2022-03-25 15:45:26 +00:00
workspace_symbol_test.go internal/lsp/source: parse symbol queries when using fastfuzzy 2022-01-19 15:06:07 +00:00