internal/lsp/cache: delete unused function
Change-Id: Ie7d488ffb21a2547ceb8bf49c4a746d3caa1c41b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/248406
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <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 121f2fc..cbb9d1a 100644
--- a/internal/lsp/cache/view.go
+++ b/internal/lsp/cache/view.go
@@ -472,35 +472,6 @@
return strings.ToLower(filepath.Base(filename))
}
-func (v *View) WorkspaceDirectories(ctx context.Context) ([]string, error) {
- // If the view does not have a go.mod file, only the root directory
- // is known. In GOPATH mode, we should really watch the entire GOPATH,
- // but that's probably too expensive.
- // TODO(rstambler): Figure out a better approach in the future.
- if v.modURI == "" {
- return []string{v.root.Filename()}, nil
- }
- // Anything inside of the module root is known.
- dirs := []string{filepath.Dir(v.modURI.Filename())}
-
- // Keep track of any directories mentioned in replace targets.
- fh, err := v.session.GetFile(ctx, v.modURI)
- if err != nil {
- return nil, err
- }
- snapshot, release := v.Snapshot(ctx)
- defer release()
-
- pm, err := snapshot.ParseMod(ctx, fh)
- if err != nil {
- return nil, err
- }
- for _, replace := range pm.File.Replace {
- dirs = append(dirs, replace.New.Path)
- }
- return dirs, nil
-}
-
func (v *View) relevantChange(c source.FileModification) bool {
// If the file is known to the view, the change is relevant.
known := v.knownFile(c.URI)