mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Implement extern crate completion
This commit is contained in:
parent
83b3ba1b81
commit
37e0e8af10
6 changed files with 105 additions and 0 deletions
|
@ -1722,6 +1722,14 @@ impl SemanticsScope<'_> {
|
|||
|name, id| cb(name, id.into()),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn extern_crates(&self) -> impl Iterator<Item = (Name, Module)> + '_ {
|
||||
self.resolver.extern_crates_in_scope().map(|(name, id)| (name, Module { id }))
|
||||
}
|
||||
|
||||
pub fn extern_crate_decls(&self) -> impl Iterator<Item = Name> + '_ {
|
||||
self.resolver.extern_crate_decls_in_scope(self.db.upcast())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue