Change information
Commit message:
gopls/mod: find references to required modules
With this CL, users will be able to click on a required module in a
go.mod file, and see the import statements that reference its
packages.
In addition to integrating with LSP clients, this code avoids
reporting imports of nested modules.
Testing: there are marker tests, but self-contained. A lot
of natural uses will be to find modules from the module cache.
I tested by hand getting references from a go.mod file in
the tools repository. For instance, when searching for references to
golang/x/tools in gopls/go.mod, for marker_test.go it finds
the 8 imports of packages in golang.org/x/tools,
but none of the many golang.go/x/tools/gopls imports.
Fixes golang/go#75810
Change-Id: I08022dd29173a6d4ea8c728c7eb8e54a462a5889
Files:
- M gopls/doc/features/navigation.md
- M gopls/doc/release/v0.22.0.md
- M gopls/internal/cache/mod.go
- A gopls/internal/mod/references.go
- M gopls/internal/server/references.go
- A gopls/internal/test/marker/testdata/references/issue75810.txt
- A gopls/internal/test/marker/testdata/references/issue75810A.txt
Change size: L
Delta: 7 files changed, 275 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Alan Donovan
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI