-
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
Filter imports on find-all-references #13186
Conversation
I'm not sure we want this by default. For example, "Find usages" on a trait should probably include the |
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
Its okay. Its my first attempt. It may be configurable. I'll use my own fork, at the worst. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should definitely have a config option that is disabled by default (ideally it wouldn't be a config but a client side filter for the results, but I don't think thats possible yet)
See https://github.com/rust-lang/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs, as for the config key, something like references_include_use
should be good I suppose
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
So. I have added config and tested on a few cases. |
Could somebody assist me? my
|
Try |
ready |
ready №2 |
Thanks! |
☀️ Test successful - checks-actions |
@Veykril note that the original intended design here is a bit different: filtering should be done in 2proto module (that is, we always return all usages, and filter out imports near the edge) This comes from perfect client thinking, which client would just classify usages in its UI (eg, it’ll show “9001 usages in imports” which is collapsed by default). don’t remember exactly, but there should be some kind of Class filed on a usage which should classify it into ctor/dtor/read/write/use/comment. |
Yes, I realized that the filtering should (and could) happen in the proto layer instead after merging as well. Meant to change that but didn't find the time today. There is a classification for this of some sort (which is very bare bones still I believe) |
Move reference imports filtering into to_proto layer Follow up to #13186
Attempt to #13184