rust-analyzer/crates
bors e4146af294 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
2024-01-31 07:53:28 +00:00
..
base-db internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
cfg Cleanup convert_path 2024-01-26 19:28:39 +01:00
flycheck Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
hir internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
hir-def internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
hir-expand internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
hir-ty internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
ide Auto merge of #16441 - Young-Flash:exclude_tests_refs, r=Veykril 2024-01-31 07:53:28 +00:00
ide-assists internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
ide-completion internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
ide-db Auto merge of #16441 - Young-Flash:exclude_tests_refs, r=Veykril 2024-01-31 07:53:28 +00:00
ide-diagnostics internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
ide-ssr Re-order mod declarations 2024-01-27 11:02:34 +01:00
intern Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
limit Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
load-cargo Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-from-ra 2024-01-21 16:53:06 +02:00
mbe Re-order mod declarations 2024-01-27 11:02:34 +01:00
parser Re-order mod declarations 2024-01-27 11:02:34 +01:00
paths Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
proc-macro-api internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
proc-macro-srv collapsible_if 2024-01-30 14:44:44 +01:00
proc-macro-srv-cli Merge commit '9d8889cdfcc3aa0302353fc988ed21ff9bc9925c' into sync-from-ra 2024-01-15 11:40:09 +02:00
profile internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
project-model internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
rust-analyzer Auto merge of #16441 - Young-Flash:exclude_tests_refs, r=Veykril 2024-01-31 07:53:28 +00:00
sourcegen Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
span Don't parse intra doc links as syntax trees 2024-01-26 20:00:47 +01:00
stdx internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
syntax internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
test-fixture Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-from-ra 2024-01-21 16:53:06 +02:00
test-utils internal: switch to tracing from log 2024-01-30 12:27:31 -05:00
text-edit Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
toolchain Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
tt Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
vfs Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-from-ra 2024-01-21 16:53:06 +02:00
vfs-notify Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-from-ra 2024-01-21 16:53:06 +02:00