Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp/cache: limit module scan to 100K files
When no go.work or go.mod file is found, gopls searches to see if there is exactly one module in a nested directory, in which case it narrows the workspace to this one module. This is a legacy workaround for polyglot repositories, and will be made obsolete by golang/go#57979. However, in the meantime this feature is still necessary, and is the last remaining place where we walk the workspace looking for modules. As reported in golang/go#56496, this search can be expensive in very large directories. Reduce the search limit 10x, from 1M->100K, and use the more efficient filepath.WalkDir. Fixes golang/go#56496 Change-Id: Ia46dd90ac2220b09debc68742dd882885c38eb42 Reviewed-on: https://go-review.googlesource.com/c/tools/+/496880 Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Findley <rfindley@google.com>
- Loading branch information