Lukas Wirth
067d87e8a9
Remove some allocs
2021-12-09 18:04:32 +01:00
Jonas Schievink
b365b6119c
Treat extern blocks as item containers
2021-12-07 17:31:26 +01:00
Aleksey Kladov
2f9273633b
feat: filter out duplicate macro completions
...
closes #9303
2021-08-03 17:36:06 +03:00
Aleksey Kladov
12d7f5b56e
internal: explain that we don't ref
in style.md
2021-08-02 15:59:28 +03:00
Aleksey Kladov
5f3662e01c
minor: encode usage convention into API
2021-08-02 15:28:39 +03:00
Lukas Wirth
97d63d67cd
Resolve paths to assoc items for traits
2021-07-19 20:51:57 +02:00
Clemens Wasser
47747cd412
Apply some clippy suggestions
2021-06-21 16:40:21 +02:00
Laurențiu Nicola
e3ce88f6f2
Minor clippy perf fixes
2021-06-18 14:40:51 +03:00
Lukas Wirth
95c8c65139
Nest all the or-patterns!
2021-06-17 17:37:14 +02:00
Maan2003
c9b4ac5be4
clippy::redudant_borrow
2021-06-13 09:24:16 +05:30
Lukas Wirth
28ca371755
Consider trait to be in scope for trait-impl
2021-05-25 16:16:29 +02:00
Jonas Schievink
7c0c713a10
Intern GenericParams
...
Also share the same instance between `ItemTree` and `generic_params`
query.
2021-04-05 03:50:10 +02:00
Jonas Schievink
2633e23f2b
resolver: manually traverse nested block scopes
2021-03-22 18:55:51 +01:00
Matthias Krüger
3d9b3a8575
remove more redundant clones (clippy::redundant_clone())
2021-03-21 12:10:39 +01:00
Lukas Wirth
cbd325707b
Track labels in scopes
2021-03-21 01:02:01 +01:00
Jonas Schievink
b885e6bdee
Delete ContainerId
2021-03-09 19:09:02 +01:00
Jonas Schievink
a430549aa6
Stop using ContainerId
in AssocContainerId
2021-03-09 18:27:23 +01:00
Jonas Schievink
12f6bdcfd9
Check ancestor maps when computing traits in scope
2021-03-09 18:27:23 +01:00
Jonas Schievink
6750c11df3
Rename a few crate_def_map
s to def_map
...
These could all be block `DefMap`s instead of crate-level `DefMap`s
2021-03-07 00:20:13 +01:00
Jonas Schievink
216dc856c5
Wrap BuiltinType
in code model
2021-02-11 19:52:33 +01:00
Jonas Schievink
85906aa304
Remove unneeded return
2021-02-09 18:40:05 +01:00
Jonas Schievink
51f68863b1
Remove pub
2021-02-09 17:36:10 +01:00
Jonas Schievink
e16d9dc5bd
Use block_def_map
in Resolver
...
This required a few changes to not bail out immediately if a
`ModuleScope` doesn't resolve a path.
The `LocalItemsScope` hack is now removed.
2021-02-09 17:27:04 +01:00
Jonas Schievink
5d99ba1d9a
Make ModPath
's representation private
2021-02-04 20:49:24 +01:00
Jonas Schievink
5c241b0766
Create all ModuleId
s through a DefMap
method
...
`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
2021-01-25 15:21:33 +01:00
Jonas Schievink
ce29730bc7
Obtain ModuleId
's DefMap
through a method
2021-01-22 16:33:58 +01:00
Daiki Ihara
f5b97e52c9
Fix broken link in intra-doc
2021-01-22 20:06:45 +09:00
Jonas Schievink
5f319ca7ee
DefMap: hide remaining crate-visible fields
2021-01-20 18:17:48 +01:00
Lukas Wirth
bed12833cc
Show const params in completions
2021-01-19 20:06:39 +01:00
Jonas Schievink
57a82fb05b
Rename CrateDefMap
to DefMap
2021-01-18 20:18:05 +01:00
Lukas Wirth
cb863390f2
Handle self/super/crate in PathSegment as NameRef
2021-01-15 19:21:23 +01:00
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
Vincent Esche
21f8239ac8
Fixed typos in code comments
2021-01-09 15:41:29 +01:00
Lukas Wirth
0acdb73076
Add ConstParams to the HIR
2021-01-01 10:06:42 +01:00
AdnoC
cca0dfa79e
we can have one less call to name.clone()
2020-12-31 13:46:13 -07:00
AdnoC
435c189c80
deduplicate macro completions from legacy macros and prelude
2020-12-31 13:41:49 -07:00
Aleksey Kladov
b28c54a2c2
Rename ra_hir_def -> hir_def
2020-08-13 16:29:33 +02:00