go/internal/lsp/command
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
..
commandmeta internal/lsp/command: add missing doc and support for result parameters 2021-06-11 15:30:39 +00:00
gen internal/lsp/command: add missing doc and support for result parameters 2021-06-11 15:30:39 +00:00
command_gen.go internal/lsp: add ListImports 2022-02-04 22:09:29 +00:00
generate.go all: fmt tests with new gofmt 2021-02-20 03:28:42 +00:00
interface.go internal/lsp: add ListImports 2022-02-04 22:09:29 +00:00
interface_test.go internal/lsp/command: rename package generate to gen 2021-02-17 22:11:19 +00:00
util.go internal/lsp/command: fix typo in comment 2021-09-19 16:34:52 +00:00