Lukas Wirth
9e8a0fae0c
Lint debug prints and disallowed types with clippy
2024-02-01 17:57:27 +01:00
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
David Barsky
e1ea7c8844
internal: switch to tracing
from log
...
This commit also adds `tracing` to NotificationDispatcher/RequestDispatcher,
bumps `rust-analyzer-salsa` to 0.17.0-pre.6, `always-assert` to 0.2, and
removes the homegrown `hprof` implementation in favor of a vendored
tracing-span-tree.
2024-01-30 12:27:31 -05:00
Young-Flash
2b71acac4f
test: add full path ref exclude test case
2024-01-29 18:47:58 +08:00
Young-Flash
1bd21e98c0
test: add test for excluding refs
2024-01-28 18:39:42 +08:00
Young-Flash
6f303f49fe
feat: enable excluding refs search results in test
2024-01-28 18:28:13 +08:00
Lukas Wirth
6584e63506
minor: Simplify
2024-01-16 13:36:07 +01:00
Lukas Wirth
9cb13b6efb
Allow navigation targets to be duplicated when the focus range lies in the macro definition site
2023-12-06 12:38:19 +01:00
Lukas Wirth
d2cd30007c
Implicit format args support
2023-12-05 17:07:00 +01:00
Lukas Wirth
5b8e386bae
Improve macro descension API
2023-12-05 17:06:57 +01:00
Young-Flash
e0276dc5dd
fix: find Self
reference
2023-11-10 19:54:43 +08:00
Lukas Wirth
53b292478d
internal: Add offset param to token descending API
2023-08-16 10:07:18 +02:00
Lukas Wirth
bcff166b3a
Add ExternCrateDecl to HIR
2023-08-02 11:52:55 +02:00
Josiah Bills
b9cef03230
Updated search to expose some more functions and to make search take the search scope by reference.
2023-07-09 17:30:21 -04:00
Lukas Wirth
a7d604d46f
fix: Fix nav target calculation discarding file ids from differing macro upmapping
2023-06-01 11:05:03 +02:00
Ariel Davis
4a1922fd1a
Depend on nohash-hasher individually
2023-05-06 00:49:23 -07:00
Lukas Wirth
f501c6a516
Refactor symbol index
2023-05-02 12:11:42 +02:00
Ryo Yoshida
f8eac19b33
Support trait aliases in IDE where type support isn't needed
2023-03-04 00:24:08 +09:00
Ryo Yoshida
098d9d77b4
Search raw identifiers without prefix
2023-02-14 17:34:14 +09:00
Lukas Wirth
951ee3d0b5
fix: Fix assoc item search finding unrelated definitions
2023-01-24 14:11:02 +01:00
Lukas Wirth
bb4e272d8a
Refine search for const and function assoc items
2023-01-11 17:10:04 +01:00
Lukas Wirth
6a06f6f724
Deduplicate reference search results
2022-11-07 16:48:50 +01:00
Lukas Wirth
cadb01c315
Move reference imports filtering into to_proto layer
2022-09-13 14:58:50 +02:00
Stanislav
f7f4792f4f
fixes
2022-09-09 20:58:06 +03:00
Stanislav
9f6553e1d6
add config for import filtering
2022-09-08 01:53:20 +03:00
Stanislav
eba54c2fc9
pretty solition works
2022-09-07 04:09:25 +03:00
Stanislav
92d54f9b30
typo and draft
2022-09-07 03:24:55 +03:00
Stanislav
bd0eeb3f04
Update crates/ide/src/references.rs
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-09-07 03:01:06 +03:00
Stanislav
6001e7dfb1
fix
2022-09-04 19:45:50 +03:00
Stanislav
ba40aa72ac
Update crates/ide/src/references.rs
...
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2022-09-04 19:41:06 +03:00
Stanislav
29729abc3c
Retain imports on find-all-references
2022-09-04 19:14:52 +03:00
Lukas Wirth
d025c5d8d6
Make use of NoHash hashing for FileId and CrateId
2022-08-25 20:41:49 +02:00
Amos Wenger
816f7fe12a
Run cargo fix --edition-idioms
2022-07-20 15:02:08 +02:00
Lukas Wirth
bb4bfae422
fix: Fix search for associated trait items being inconsistent
2022-07-20 13:59:31 +02:00
Lukas Wirth
ad537be194
fix: When reference searching macro inputs, don't search everything that was downmapped
2022-05-23 16:09:56 +02:00
Lukas Wirth
4255996965
Re-export FxHashMap
and FxHashSet
from ide_db
2022-04-25 18:51:59 +02:00
Lukas Wirth
58660dee2a
fix: Do reference search on all downmapped tokens with the same kind only
2022-04-15 19:42:48 +02:00
Lukas Wirth
1f1185dcbb
Specific proc-macro crate type for other test fixture where needed
2022-03-09 22:18:09 +01:00
Lukas Wirth
e759db361e
Resolve functions as proc-macros via FileAstId
2022-02-23 11:21:46 +01:00
Lukas Wirth
b494795a42
update references::derive test output
2022-02-22 10:52:35 +01:00
Lukas Wirth
0d3cd90d08
Move fn to proc-macro conversion to name classification
2022-02-21 17:56:11 +01:00
Lukas Wirth
cef8a17ea5
Handle proc-macro functions as the proc-macro they resolve to
2022-02-11 22:06:03 +01:00
Lukas Wirth
6746ba5839
Record attribute calls on assoc items in TraitData and ImplData
2022-01-08 10:45:12 +01:00
Lukas Wirth
5206946674
fix: Partially fix ide_db::search
for crate roots
2021-12-20 17:48:47 +01:00
Lukas Wirth
54b2de45e1
Unnest ide::display::navigation_target module
2021-11-22 13:04:28 +01:00
Lukas Wirth
366499c3be
Do not use reference search in runnables::related_tests
2021-11-16 21:32:02 +01:00
Lukas Wirth
0ff380fe17
Simplify
2021-11-16 21:26:34 +01:00
Lukas Wirth
7776aad166
internal: Flatten Definition::ModuleDef
variant
2021-11-11 00:05:53 +01:00
Aleksey Kladov
12103b16de
internal: untangle usages of ReferenceCategory somewhat
...
Not everything that can be read or write is a reference, let's try to
use more precise types.
2021-10-02 13:02:06 +03:00
Aleksey Kladov
46eb03d99a
internal: use naming that matches intended use-case
2021-10-02 12:18:18 +03:00