gopls/internal/lsp/cache: unexport ValidBuildConfiguration
In general, the source package should not need to know about build
configurations. Remove this unused interface method, and unexport.
Change-Id: I91ba24e5bc2d172046ccaf3c46d2eb3f70e7bc42
Reviewed-on: https://go-review.googlesource.com/c/tools/+/495057
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/gopls/internal/lsp/cache/snapshot.go b/gopls/internal/lsp/cache/snapshot.go
index 45a32a1..7988a72 100644
--- a/gopls/internal/lsp/cache/snapshot.go
+++ b/gopls/internal/lsp/cache/snapshot.go
@@ -321,7 +321,7 @@
return tmpls
}
-func (s *snapshot) ValidBuildConfiguration() bool {
+func (s *snapshot) validBuildConfiguration() bool {
// Since we only really understand the `go` command, if the user has a
// different GOPACKAGESDRIVER, assume that their configuration is valid.
if s.view.hasGopackagesDriver {
@@ -379,7 +379,7 @@
// If the view has an invalid configuration, don't build the workspace
// module.
- validBuildConfiguration := s.ValidBuildConfiguration()
+ validBuildConfiguration := s.validBuildConfiguration()
if !validBuildConfiguration {
return mode
}
@@ -1448,8 +1448,8 @@
If you are using modules, please open your editor to a directory in your module.
If you believe this warning is incorrect, please file an issue: https://github.com/golang/go/issues/new.`
-func shouldShowAdHocPackagesWarning(snapshot source.Snapshot, active []*source.Metadata) string {
- if !snapshot.ValidBuildConfiguration() {
+func shouldShowAdHocPackagesWarning(snapshot *snapshot, active []*source.Metadata) string {
+ if !snapshot.validBuildConfiguration() {
for _, m := range active {
// A blank entry in DepsByImpPath
// indicates a missing dependency.
@@ -1559,7 +1559,7 @@
// If the view's build configuration is invalid, we cannot reload by
// package path. Just reload the directory instead.
- if !s.ValidBuildConfiguration() {
+ if !s.validBuildConfiguration() {
scopes = []loadScope{viewLoadScope("LOAD_INVALID_VIEW")}
}