rust/crates
bors[bot] a0322defc3
Merge #7656
7656: Implement constructor usage search for almost all items r=matklad a=Veykril

This PR moves the filering for enum constructors to the HIR, with this unprefixed variants as well as when the enum has been renamed via use will then still show up properly.
We now walk the ast of the `NameRef` up until we find a `PathExpr`(which also handles `CallExpr` for tuple-type structs and variants already) or a `RecordExpr`. For enum search we then take the `path` out of that expression and do a resolution on it to compare it with the definition enum.
With this PR we now support searching for all constructor literals, Unit-, Tuple- and Record-Structs, Unit-, Tuple- and Record-Variants as well as Unions.

There is one shortcoming due to how the search is triggered. Unit Variants constructors can't be searched as we have no position for it to kick off the search(since a comma doesn't have to exist for the last variant).

Closes #2549 though it doesn't implement it as outlined in the issue since the reference kind was removed recently, though I believe the approach taken here is better personally.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-02-14 16:17:03 +00:00
..
assists Merge #7656 2021-02-14 16:17:03 +00:00
base_db Fix warnings when running cargo doc --document-private-items 2021-01-18 16:44:40 -05:00
cfg Upgrade expect-test to 1.1 2021-01-03 14:43:29 +01:00
completion Complete builtin type paths 2021-02-11 19:52:46 +01:00
flycheck Make logger-based debugging more pleasant 2021-01-28 17:07:53 +03:00
hir Wrap BuiltinType in code model 2021-02-11 19:52:33 +01:00
hir_def Wrap BuiltinType in code model 2021-02-11 19:52:33 +01:00
hir_expand add more counts 2021-01-27 12:39:19 +03:00
hir_ty Wrap BuiltinType in code model 2021-02-11 19:52:33 +01:00
ide Merge #7656 2021-02-14 16:17:03 +00:00
ide_db Don't classify attribute macros as their path unless it's a function with the proc_macro_attribute attribute 2021-02-13 22:11:31 +01:00
mbe Make sure normal dependencies always have version 2021-02-03 12:51:07 +00:00
parser Pin Rust to 1.49.0 on CI 2021-02-12 13:05:56 +01:00
paths Document paths items 2021-01-22 15:38:33 +01:00
proc_macro_api Remove redundant clones 2021-02-05 16:57:26 +01:00
proc_macro_srv libloading 0.7 2021-02-11 10:07:49 -05:00
proc_macro_test
profile add more counts 2021-01-27 12:39:19 +03:00
project_model Allow automatically detect the rustc-src directory (fixes #3517). 2021-02-13 18:20:46 +01:00
rust-analyzer Merge #7643 #7663 2021-02-14 15:42:07 +00:00
ssr . 2021-01-20 01:56:11 +03:00
stdx Cleanup decl_check 2021-02-05 16:09:45 +01:00
syntax Don't rename field record patterns directly 2021-02-13 23:47:21 +01:00
test_utils Add parsing benchmark 2021-02-09 21:52:34 +03:00
text_edit
toolchain
tt Refactor TokenBuffer for reduc cloning 2021-01-05 02:00:46 +08:00
vfs Fix slow tests sometimes failing 2021-02-12 16:31:16 +01:00
vfs-notify Fix slow tests sometimes failing 2021-02-12 16:31:16 +01:00