Skip to content

Commit

Permalink
internal/lsp: ignore errors when finding workspace modules
Browse files Browse the repository at this point in the history
Fixes golang/go#41558

Change-Id: If00cdb310575ac195ce8ebce7f156e0daa192b8d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/256578
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>
  • Loading branch information
stamblerre committed Sep 23, 2020
1 parent f5e916c commit ba800b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/lsp/cache/session.go
Expand Up @@ -256,8 +256,9 @@ func findWorkspaceModules(ctx context.Context, root span.URI, options *source.Op
// Walk the view's folder to find all modules in the view.
modules := make(map[span.URI]*moduleRoot)
return modules, filepath.Walk(root.Filename(), func(path string, info os.FileInfo, err error) error {
// Ignore any errors we may encounter while visiting files.
if err != nil {
return err
return filepath.SkipDir
}
// For any path that is not the workspace folder, check if the path
// would be ignored by the go command. Vendor directories also do not
Expand Down

0 comments on commit ba800b1

Please sign in to comment.