mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
scope-based resolve path
This commit is contained in:
parent
68f66e0f44
commit
f4860870da
3 changed files with 53 additions and 21 deletions
|
@ -42,8 +42,7 @@ pub(super) fn completions(
|
|||
let module_scope = module.scope(db)?;
|
||||
acc.extend(
|
||||
module_scope
|
||||
.items
|
||||
.iter()
|
||||
.entries()
|
||||
.filter(|(_name, res)| {
|
||||
// Don't expose this item
|
||||
match res.import {
|
||||
|
@ -162,14 +161,11 @@ fn complete_path(
|
|||
Some(it) => it,
|
||||
};
|
||||
let module_scope = target_module.scope(db)?;
|
||||
let completions = module_scope
|
||||
.items
|
||||
.iter()
|
||||
.map(|(name, _res)| CompletionItem {
|
||||
label: name.to_string(),
|
||||
lookup: None,
|
||||
snippet: None,
|
||||
});
|
||||
let completions = module_scope.entries().map(|(name, _res)| CompletionItem {
|
||||
label: name.to_string(),
|
||||
lookup: None,
|
||||
snippet: None,
|
||||
});
|
||||
acc.extend(completions);
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue