-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp/source/completion: ensuring completion completeness
Ensure that completion processes at least depth=0 elements, by switching to a different model for truncating search. Don't encode the search deadline in the context, as the handling for context cancellation should differ from the handling of being out of budget. For example, we should not fail to format a completion item if we are out of budget. While at it, don't include type checking time in the completion budget, as it is highly variable and depends on the ordering of requests from the client: for example, if the client has already requested code lens, then the type-checked package will already exist and completion will not include type-checking in the budget. No documentation needs to be updated as the current documentation already says "this normally takes milliseconds", which can only be true if it doesn't include type checking. Also add a regression test that asserts we find all struct fields in completion results. Fixes golang/go#53992 Change-Id: I1aeb749cf64052b6a444166638a78b9945964e84 Reviewed-on: https://go-review.googlesource.com/c/tools/+/503016 Auto-Submit: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information
Showing
5 changed files
with
94 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters