Skip to content

tools: replace use of 'gopkgs' with 'go list all'  #258

@marwan-at-work

Description

@marwan-at-work

Currently, if you cmd+shift+P and choose Go: Add Import. The list of imported file looks incorrect. For example, packages within the same module do not show up.

To reproduce, go into a module repo such as golang.org/x/tools and open a Go file such as internal/lsp/source/rename.go.

Try to run the Go: Add Import and notice the list does not include most of the packages that you expect within the tools repo. Or even sometimes you get this error:

Could not find packages. Ensure `gopkgs -format {{.Name}};{{.ImportPath}}` runs successfully.

As a solution, I don't think we have to call out into gopkgs anymore as we can just call go list directly to get all importable paths within a directory.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions