-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Code completion order arbitrary #51762
Comments
I'm surprised. I would have expected the order to be stable. We certainly haven't seen any flakiness on the bots. Can you point me to the unrelated CL? I'll probably need to step through the debugger to understand where the change in the order is occurring. |
Before my change:
Why does B01 have the class kind first, and the others have the |
It isn't a very satisfying answer, but the truth it that the completion support was organically grown, so some of the code is duplicated in ways that introduce inconsistencies like that. It's something I hope to be able to address next quarter. |
I think we probably cannot expect that the server returns completion suggestions in any particular order. We try to sort suggestions in our tests, specifically to prevent such random order changes. |
Why? Is there some non-determinism that I'm forgetting about?
That seems reasonable to me, at least for these tests. The purpose of these tests is not to test the order of the suggestions, just the presence or absence. But I'd suggest that we stop sorting by relevance. I don't want to have to re-write the expectations every time the relevance changes. We have separate tests for relevance and shouldn't be testing that here, especially since the fact that it's being tested for is hidden. |
Bug: #51762 Change-Id: I46019bea72ac1656c97acb9da88da7dc577d8ef5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292640 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The order of class and constructor definitions is undefined:
https://dart-review.googlesource.com/c/sdk/+/283341/2/pkg/analysis_server/test/services/completion/dart/location/relational_pattern_test.dart#113
I'm getting class/constructor reorderings on an unrelated CL.
cc @bwilkerson @scheglov
The text was updated successfully, but these errors were encountered: