-
Notifications
You must be signed in to change notification settings - Fork 18k
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: don't apply completion budget to shallow completions #41434
Comments
@stamblerre, is the behavior change you made in golang.org/cl/227303 still the one we want? If not this would be an easy fix for @dandua98. |
This might actually be fixed (in 0.5.1) now that deep completion is bfs and is triggered at the end of completions. I think this might be one of those scenarios with very large packages where we end up going too deep and not finding anything. Would need to be able to reproduce this and verify though. |
It may have been improved, but I think it's still an open question whether we want to ever give up on searching the first level. |
No, I think in that CL was a mistake on my part. If deep completions is more "isolated" now, it would be nice to only apply that timeout to deep completions, but to start the timer when the completion request starts. (I think I may have thought that that's what I was doing in that CL, but clearly I did it wrong...) |
Change https://golang.org/cl/257974 mentions this issue: |
Change https://golang.org/cl/258286 mentions this issue: |
…before unimported completions Unimported completions are expensive and can use up a large portion of completion budget just to find initial deep search candidates. This change moves these expensive operations which search through the module cache to after normal deep completions so we search through more useful candidates first. Fixes golang/go#41434 Fixes golang/go#41665 Change-Id: I6f3963f8c65c1a97833a35738d2e96420de2f6ee Reviewed-on: https://go-review.googlesource.com/c/tools/+/257974 Run-TryBot: Danish Dua <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> Trust: Danish Dua <[email protected]> (cherry picked from commit c43c25c) Reviewed-on: https://go-review.googlesource.com/c/tools/+/258286 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Danish Dua <[email protected]> Trust: Rebecca Stambler <[email protected]>
Some feedback on this change. In our largest package I still need to keep |
Change https://golang.org/cl/262347 mentions this issue: |
…low completions Type-checking can be very expensive for large packages and leave no budget for shallow completions. This change adds a minimum budget of 10ms so we show the user at least some shallow suggestions. Updates golang/go#41434 Change-Id: If2ef59c3fbdcfa2ebaabb21256cf606a4f9c14d6 Reviewed-on: https://go-review.googlesource.com/c/tools/+/262347 Trust: Danish Dua <[email protected]> Run-TryBot: Danish Dua <[email protected]> gopls-CI: kokoro <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> TryBot-Result: Go Bot <[email protected]>
Tested this in |
Glad to hear it! I'll close this issue then. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (0.5.0). Also tested in (0.4.4).
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
For large packages the completion was timing out. For example, typing
fmt.
produced no results. Using a local struct variablestruct1.
produced no results.@heschik found the workaround. Adding:
to my vscode config gave the completion code more time to read the very large package. Now completion items are coming up.
There may be a bug here as:

(slack convo)
What did you expect to see?
I expected to see the
fmt
public package methods and the methods attached tostruct1
.What did you see instead?
No completions came up.
The text was updated successfully, but these errors were encountered: