about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-31 07:53:28 +0000
committerbors <bors@rust-lang.org>2024-01-31 07:53:28 +0000
commite4146af29494768b0075e2fea2a56b699b0f9141 (patch)
tree296c80710ed54389621ff8e46b53648f389056fe /tests/codegen/src-hash-algorithm
parent9a832c47e85e94496e10e1e81636d3d89afeb0d4 (diff)
parent2b71acac4f07565907cc19737b92b63750911c3f (diff)
downloadrust-e4146af29494768b0075e2fea2a56b699b0f9141.tar.gz
rust-e4146af29494768b0075e2fea2a56b699b0f9141.zip
Auto merge of #16441 - Young-Flash:exclude_tests_refs, r=Veykril
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
Diffstat (limited to 'tests/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions