-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: completion list suggests methods in the order we most likely want #16044
Conversation
new
like functions first
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
This has been warn-by-default for two years now and has already been added to the future-incompat lints in 1.68.
This reverts commit 6d2543b.
…n the macro definition site
Before Private functions have RawVisibility module, but were missed because take_types returned None early. After resolve_visibility returned None, Visibility::Public was set instead and private functions ended up being offered in autocompletion. Choosing such a function results in an immediate error diagnostic about using a private function. After Pattern match of take_types that returns None and query for Module-level visibility from the original_module Fix rust-lang#15134 - tested with a unit test and a manual end-to-end test of building rust-analyzer from my branch and opening the reproduction repository REVIEW Refactor to move scope_def_applicable and check function visibility from a module Please let me know what's the best way to add a unit tests to nameres, which is where the root cause was
colon_complete_preferred_order_relevances
methods in render function
652b132
to
1eac62a
Compare
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits (since this message was last posted): |
When typing
MyType::
the completion items' order could be re-ordered based on how likely we want to select those:new
like functions to be able to create the type,Self
,In this photo, the order is:
new
constructor is firstnew_builder
second is a builder methodaaaanew
is a constructor that takes arguments, is third and is irrespective of its alphabetical order among names.I've dropped my previous idea of highlighting these functions in the rustdoc (rust-lang/rust#107926)