1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00
go/internal/lsp/mod
Rebecca Stambler 1745ac5bc6 internal/lsp: refactor various module-specific handles in cache
This change separates out different functions of mod handles.
Previously, we had ModHandle and ModTidyHandle. ModHandle was used to
parse go.mod files and get the results of `go mod why` and possible
dependency upgrades.

Now, we factor this out into 4 handles: ParseModHandle, ModWhyHandle,
ModUpgradeHandle, and ModTidyHandle. This allows each handle to be
specific to its own functionality. It also simplifies the code a bit,
as the handles can be written in terms of ParseModHandles instead of
FileHandles.

I may have some follow-up CLs to refactor the `go mod tidy` logic out of
the cache package, though I'm no longer certain that that's a good
choice.

Change-Id: I8e12299dfdda7bb61b05903d9aa474461d7f4836
Reviewed-on: https://go-review.googlesource.com/c/tools/+/239117
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-06-23 18:31:46 +00:00
..
testdata/unchanged internal/lsp/tests: fix reset of golden files 2020-02-19 14:42:13 +00:00
code_lens.go internal/lsp: refactor various module-specific handles in cache 2020-06-23 18:31:46 +00:00
diagnostics.go internal/lsp: refactor various module-specific handles in cache 2020-06-23 18:31:46 +00:00
format.go internal/lsp: refactor various module-specific handles in cache 2020-06-23 18:31:46 +00:00
hover.go internal/lsp: refactor various module-specific handles in cache 2020-06-23 18:31:46 +00:00
mod_test.go internal/lsp: use a new temporary go.mod for every go list call 2020-06-18 02:37:23 +00:00