Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: add temporary setting(s) to optionally disable zero-config algorithms #65515

Closed
findleyr opened this issue Feb 4, 2024 · 1 comment
Assignees
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Feb 4, 2024

Defensive issue. The zero-config behavior added in #57979 means that gopls works in a lot of cases where it didn't work at all before. In particular, with dynamic build tag support (#29202), gopls will select build contexts to cover a lot of files that it couldn't previously load.

I'm excited for the simpler workspace configuration, but I worry that the newly automatic behavior may be surprising in some cases, for example #65496, where gopls "correctly" identifies a build error in an unsupported port. Additionally, while all this was enabled by our scalability work, having many different build contexts still incurs an overhead, and that may not be desirable in some huge repositories.

I think we should proceed with the new default behavior -- after all the idea was to make gopls "just work" in more cases -- but I think we should add hidden settings to disable (1) dynamic workspace views and (2) dynamic build tag support, in case users encounter unforeseen issues. My guess is that dynamic workspace layout detection is almost always desirable, but build tag behavior is more likely to be confusing.

This won't be hard: we just need to truncate the selectViewDefs algorithm if these defensive settings are present.

CC @adonovan

@findleyr findleyr added this to the gopls/v0.15.0 milestone Feb 4, 2024
@findleyr findleyr self-assigned this Feb 4, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 4, 2024
@findleyr findleyr changed the title x/tools/gopls: add temporary setting(s) to disable zero-config algorithms x/tools/gopls: add temporary setting(s) to optionally disable zero-config algorithms Feb 4, 2024
@gopherbot
Copy link

Change https://go.dev/cl/562856 mentions this issue: gopls/internal/settings: add a hidden option to disable zero config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants