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: document a framework for configuration decisions #61001

Open
findleyr opened this issue Jun 26, 2023 · 0 comments
Open

x/tools/gopls: document a framework for configuration decisions #61001

findleyr opened this issue Jun 26, 2023 · 0 comments
Labels
Documentation gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

We regularly get requests to add new configuration to gopls. These fall into different categories: some are UX-related, others are making certain parameters configurable, still others fundamentally change the way gopls behaves, in order for it to function better in certain environments.

We've learned the hard way that each new configuration option has a significant cost. Off the top of my head:

  • Complexity: having a wall of settings can overwhelm users, and suggests that gopls doesn't work well out of the box.
  • Maintainability: every new configuration option is itself a feature that must be implemented, maintained, or deprecated (and deprecation itself has its own burden).
  • Testability: particularly for configuration that affects gopls' core operations (such as "memoryMode", "allowModfileModifications", or "completionBudget", each new configuration option can introduce a new dimension in a parameter space that must be (theoretically) be tested. Eventually, this parameter space becomes too large, and our test coverage fails us: example 1, example 2.

After experiencing the cost of our existing configuration, we increasingly push back on any new configuration. But absent context I think this can feel arbitrary to our users. Every request for new configuration comes with a good reason, and it's hard to argue that this benefit is more than offset by some abstract cost. Furthermore, we may sometimes reject reasonable configuration due to this reaction to past decisions.

Therefore, I think we need a formal framework for making decisions about new configuration, similar to the framework cmd/vet has for new analyses.

This issue tracks deciding upon and documenting that framework.

Again off the top of my head, I'd want something like this:

  • Understandability: can the configuration be interpreted without understanding details of gopls internals? If not, then the configuration either needs to be re-framed, or gopls should be made to Just Work.
  • Usefulness: would a large fraction of users use the configuration? If not, then it may not be worth the costs above.
  • Necessity: is there there no way to choose a default behavior that works better for more users, such that the usefulness of the previous section is reduced?
  • Superficiality / Orthogonality: does the configuration deeply affect the way that gopls works? Does it interact with other configuration? If yes to either question, then it should be avoided at all costs.

(I'll reiterate that these heuristics are just a starting point for discussion).

CC @golang/tools-team

@findleyr findleyr added this to the gopls/v0.13.0 milestone Jun 26, 2023
@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. Documentation labels Jun 26, 2023
@findleyr findleyr modified the milestones: gopls/v0.14.0, gopls/v0.15.0 Sep 20, 2023
@findleyr findleyr modified the milestones: gopls/v0.15.0, gopls/v0.16.0 Dec 12, 2023
@findleyr findleyr modified the milestones: gopls/v0.16.0, gopls/v0.17.0 Mar 13, 2024
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2024
@findleyr findleyr modified the milestones: gopls/v0.17.0, gopls/v0.18.0 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants