x/tools/gopls: cannot choose the "right" value for completionBudget #63459
Labels
gopls/imports
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
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Picking up the conversation from https://gophers.slack.com/archives/CRWSN9NCD/p1696429330059839
For the purposes of the discussion below, here are two example completions:
Example 1: a qualified identifier, unimported completion:
This should resolve to
cuelang.org/go/cue/load.Instances
.Example 2: an unqualified completion:
My understanding based on the exchange with @findleyr on Slack of the current semantics around
completionBudget
is as follows:completionBudget
needs to be set to a "high" value in order that unimported completions (of the form taken in Example 1) don't time out, especially after a load from a cold cache but not limited to that. A large module cache in effect "forces" us to set a "high" value in this instance, because of the cost of (scanning and) searching the module cache.completionBudget
needs to be set to a "low" value in order that unqualified completions (of the form taken in Example 2) don't take a long time. Per @findleyr:The issue: if I choose a "high" value then Example 2 style completions can take ~200-250ms... which is very noticeable and annoying especially when the editor requests multiple in sequence as a completion candidate is refined. If I choose a "low" value, then I don't get unimported completions of Example 1 style in all situations.
I therefore cannot choose the "right" value.
What did you expect to see?
Being able to set a
completionBudget
that satisfies both cases, Examples 1 and 2.What did you see instead?
The above.
Per @findleyr on Slack:
cc @findleyr
The text was updated successfully, but these errors were encountered: