go/gopls/internal/regtest/misc
Heschi Kreinick 414ec9c3f0 internal/lsp: add ListImports
The VS Code extension uses information about imports to figure out
whether a given function is a Testify test. As of writing, it asks:
- Does the file import Testify?
- Does the package it's in do so?
To answer these questions, add ListImports, which tells you about the
packages imported by the current file, including their import name,
plus the import paths of all imports in the entire package.

I suspect the latter may be wrong in the presence of GOPATH vendoring,
but that should be a relatively rare situation at this point so I didn't
bother testing.

Fixes golang/go#40514.

Change-Id: I4c69e1db80dce6e594bdb595a81aade1ddec4d29
Reviewed-on: https://go-review.googlesource.com/c/tools/+/383354
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-04 22:09:29 +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 internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +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 internal/lsp/source: don't format generated files 2021-12-06 16:11:25 +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: handle panic in hoverRune by using token.Pos 2021-09-22 23:41:20 +00:00
import_test.go internal/lsp: add ListImports 2022-02-04 22:09:29 +00:00
imports_test.go internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +00:00
link_test.go internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +00:00
misc_test.go internal/lsp: move gopls/internal/regtest -> internal/lsp/regtest 2021-04-23 16:19:37 +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: fix panic in find references on Error 2021-09-15 17:19:52 +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
shared_test.go internal/lsp/regtest: fix a panic TestResolveImportCycle 2021-07-09 17:21:04 +00:00
vendor_test.go gopls/internal/regtest/misc: skip TestInconsistentVendoring on Windows 2021-11-17 17:12:49 +00:00
workspace_symbol_test.go internal/lsp/source: parse symbol queries when using fastfuzzy 2022-01-19 15:06:07 +00:00