mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Some cleanup and additional tests
This commit is contained in:
parent
d571d26955
commit
c5852f422f
7 changed files with 138 additions and 31 deletions
|
@ -46,7 +46,6 @@ pub(crate) enum Scope {
|
|||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Resolution {
|
||||
// FIXME make these tuple variants
|
||||
/// An item
|
||||
Def(ModuleDef),
|
||||
/// A local binding (only value namespace)
|
||||
|
@ -85,7 +84,7 @@ impl Resolver {
|
|||
|
||||
pub fn all_names(&self) -> FxHashMap<Name, PerNs<Resolution>> {
|
||||
let mut names = FxHashMap::default();
|
||||
for scope in &self.scopes {
|
||||
for scope in self.scopes.iter().rev() {
|
||||
scope.collect_names(&mut |name, res| {
|
||||
let current: &mut PerNs<Resolution> = names.entry(name).or_default();
|
||||
if current.types.is_none() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue