golang/go

x/tools/gopls: consider replace directives in the zero-config algorithm

findleyr opened this issue · 2 comments

After a little time using the zero-config algorithm (#57979), it has become apparent to me that we should consider replace directives within the workspace.

Specifically, I noticed while navigating around Kubernetes that gopls creates too many unnecessary views for modules in the staging directory.

If a module replaces a directory contained in the workspace, the selectViews algorithm should merge those views.

CC @adonovan @hyangah

Change https://go.dev/cl/562679 mentions this issue: gopls/internal/cache: check views on any on-disk change to go.mod files

Change https://go.dev/cl/562680 mentions this issue: gopls/internal/cache: treat local replaces as workspace modules