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
Find References, but filter tests #13443
Comments
Looking at the Find References Request documentation, it seems that it just takes a text location and then returns a list of references. There is no concept of filtering or context in the LSP protocol. That makes me think that this is something that should be implemented in the editor instead? (FWIW I find this specific request really interesting because in my day to day work I often run into these kind of wishes where my editor (Helix in my case) follows LSP to the letter and exposes the protocol really nicely, but where I really want something on top of that, similar to this request. Like for example "Find references to this in the files I have open" or "Find references to this in files recently changed". I think there are some really big opportunities to do some cool things that go beyond just supporting the LSP protocol.) |
There already some amount of logic in the code that categorize references: rust-analyzer/crates/ide-db/src/search.rs Lines 66 to 76 in feefbe7
I also miss this feature when working rust. IntelliJ for example can show usages grouped by read/write, prod/test etc.. I'd like to take a stab at implementing this but I'm still learning the code base and this doesn't look very easy (to me). |
The current system for that won't work too well. |
There's also related tests, which could be used in some variant maybe |
A workaround could be to run rust-analyzer temporarily with the test feature disabled, so the |
I usually use find references to get an understanding of the code, where the dependencies are and what a call-stack looks like.
rust-analyzer references is really helpful there, but one issue is that it is cluttered with references from tests. It would be nice to add a option to filter references from tests.
The text was updated successfully, but these errors were encountered: