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
..
2021-01-13 16:04:37 -07:00
2021-01-07 19:11:27 +03:00
2021-01-11 13:37:28 +00:00
2021-01-11 08:27:16 -05:00
2021-01-10 18:16:29 +00:00
2021-01-14 10:00:46 +00:00
2021-01-09 15:41:29 +01:00
2021-01-14 09:07:15 +00:00
2021-01-14 09:07:15 +00:00
2021-01-09 15:41:29 +01:00
2021-01-10 18:16:29 +00:00
2021-01-11 08:27:16 -05:00
2021-01-06 18:16:04 +03:00
2021-01-11 08:27:16 -05:00
2021-01-13 17:40:45 +00:00
2021-01-10 14:36:15 +03:00
2021-01-10 18:16:29 +00:00
2021-01-09 15:41:29 +01:00
2021-01-05 02:00:46 +08:00