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: clean up view workspace information
Tracking of workspace information in the View contained several inconsistencies and redundancies. Clean this up, with the following changes: - eliminate the View.rootURI, opting to derive it instead - eliminate the View.explicitGowork field, instead using the view.gowork field and checking if it is outside of the workspace. - eliminate many places where directory filters were interpreted relative to the rootURI. This is wrong: directory filters are expressed relative to the workspace folder. - remove special handling of GOMODCACHE, now that we're on Go 1.16+ - rewrite the locateTemplateFiles function to use view.filterFunc and filepath.WalkDir (now that we're on Go 1.16+). - don't request goimports env vars when loading environment variables for the view. They weren't being propagated to goimports anyway, and goimports will load them as needed. For golang/go#55331 Change-Id: I5e7f7e77e86d9ae425d2feaff31030278fed8240 Reviewed-on: https://go-review.googlesource.com/c/tools/+/459789 Reviewed-by: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information