mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-19 16:44:21 +00:00
e4146af294
feat: enable excluding refs search results in test ## Change Here I introduce a new `ReferenceCategory::Test` type to indicate whether the function where this reference is located is marked as `#[test]`, and expose an config item (`rust-analyzer.references.excludeTests`) to client. I also changed the signature of `ReferenceCategory::new`, adding a `sema: &Semantics<'_, RootDatabase>` param to do some hir analysis. Hope the current implementation is good to go. ## Demo `"rust-analyzer.references.excludeTests": false` ![include](https://github.com/rust-lang/rust-analyzer/assets/71162630/9f1176d4-7b41-4f49-ac79-55d25a42d5d1) `"rust-analyzer.references.excludeTests": true` ![exclude](https://github.com/rust-lang/rust-analyzer/assets/71162630/2938b44b-9e5b-48de-a049-453f5bbc09d0) close https://github.com/rust-lang/rust-analyzer/issues/14530 |
||
---|---|---|
.. | ||
generated | ||
imports | ||
syntax_helpers | ||
test_data | ||
tests | ||
active_parameter.rs | ||
apply_change.rs | ||
assists.rs | ||
defs.rs | ||
documentation.rs | ||
famous_defs.rs | ||
helpers.rs | ||
items_locator.rs | ||
label.rs | ||
lib.rs | ||
path_transform.rs | ||
rename.rs | ||
rust_doc.rs | ||
search.rs | ||
source_change.rs | ||
symbol_index.rs | ||
traits.rs | ||
ty_filter.rs | ||
use_trivial_constructor.rs |