rust/crates
bors[bot] 184f4cbf5d
Merge #7110
7110: Deduplicate macros when offering completion r=matklad a=AdnoC

Closes https://github.com/rust-analyzer/rust-analyzer/issues/7081

When iterating over the names within the `hir_def::resolver::Scope` for a module, track what macros are in the `hir_def::item_scope::ItemScope::legacy_macros` collection for the module. When iterating over names from the prelude, do not proccess the name if it had been in the `legacy_macros` collection.

This is implemented with a `FxHashSet` in the `Scope::process_names` function that is populated when iterating over `legacy_macros` and checked when iterating over the prelude.

Alternative implementation could instead query the `legacy_macros` `FxHashMap` directly when processing names in the prelude.

Also, I'd like to add a test for this, but I'm not sure where it could be added.

Co-authored-by: AdnoC <adam.r.cutler@gmail.com>
2021-01-14 10:00:46 +00:00
..
arena Add TBD description to arena 2020-08-24 13:29:10 +02:00
assists Sort impls by trait definition 2021-01-13 16:04:37 -07:00
base_db Better fixture highlight 2021-01-07 19:11:27 +03:00
cfg Upgrade expect-test to 1.1 2021-01-03 14:43:29 +01:00
completion Merge #7051 #7219 #7245 #7246 2021-01-11 13:37:28 +00:00
flycheck Unfreeze cargo_metadata 2021-01-11 08:27:16 -05:00
hir Merge #7218 2021-01-10 18:16:29 +00:00
hir_def Merge #7110 2021-01-14 10:00:46 +00:00
hir_expand Fixed typos in code comments 2021-01-09 15:41:29 +01:00
hir_ty Render Fn* trait objects and impl types as rust does 2021-01-13 13:29:47 +01:00
ide Merge #7260 2021-01-14 09:07:15 +00:00
ide_db Merge #7260 2021-01-14 09:07:15 +00:00
mbe Fixed typos in public type names 2021-01-09 15:41:29 +01:00
parser Merge #7218 2021-01-10 18:16:29 +00:00
paths Add description for crates that will be published 2020-08-24 13:07:22 +02:00
proc_macro_api Fixed typos in code comments 2021-01-09 15:41:29 +01:00
proc_macro_srv Unfreeze cargo_metadata 2021-01-11 08:27:16 -05:00
proc_macro_test Add description for crates that will be published 2020-08-24 13:07:22 +02:00
profile Less confusing instr stat 2021-01-06 18:16:04 +03:00
project_model Unfreeze cargo_metadata 2021-01-11 08:27:16 -05:00
rust-analyzer Merge #7220 2021-01-13 17:40:45 +00:00
ssr Rename FileReferences -> UsageSearchResult 2021-01-12 15:56:24 +01:00
stdx Cleaner API 2021-01-10 14:36:15 +03:00
syntax Merge #7218 2021-01-10 18:16:29 +00:00
test_utils Fixed typos in code comments 2021-01-09 15:41:29 +01:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain Add description for crates that will be published 2020-08-24 13:07:22 +02:00
tt Refactor TokenBuffer for reduc cloning 2021-01-05 02:00:46 +08:00
vfs Use file_set::FileSet and FileSet consistently in doc 2021-01-07 12:18:25 +01:00
vfs-notify Follow symlinks when walking project trees 2020-10-15 14:22:36 -04:00