internal/lsp/cache: actually remove the view's modURI and sumURI
Should've done this in an earlier CL.
Change-Id: Id0b39c80802c4902f6986d1909112ebba3a9751c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/258939
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go
index fbb2241..5af7801 100644
--- a/internal/lsp/cache/view.go
+++ b/internal/lsp/cache/view.go
@@ -142,9 +142,6 @@
// It includes the values of the environment variables above.
goEnv map[string]string
- // The real go.mod and go.sum files that are attributed to a view.
- modURI, sumURI span.URI
-
// rootURI is the rootURI directory of this view. If we are in GOPATH mode, this
// is just the folder. If we are in module mode, this is the module rootURI.
rootURI span.URI
@@ -876,15 +873,10 @@
tool, _ := exec.LookPath("gopackagesdriver")
hasGopackagesDriver := gopackagesdriver != "off" && (gopackagesdriver != "" || tool != "")
- var modURI, sumURI span.URI
+ var modURI span.URI
if envVars.gomod != os.DevNull && envVars.gomod != "" {
modURI = span.URIFromPath(envVars.gomod)
}
- // Set the sumURI, if the go.sum exists.
- sumFilename := filepath.Join(filepath.Dir(envVars.gomod), "go.sum")
- if stat, _ := os.Stat(sumFilename); stat != nil {
- sumURI = span.URIFromPath(sumFilename)
- }
root := folder
if options.ExpandWorkspaceToModule && modURI != "" {
root = span.URIFromPath(filepath.Dir(modURI.Filename()))
@@ -896,8 +888,6 @@
rootURI: root,
environmentVariables: envVars,
goEnv: env,
- modURI: modURI,
- sumURI: sumURI,
}, nil
}