mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Merge #1783
1783: simplify r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
a73b424e3b
1 changed files with 40 additions and 38 deletions
|
@ -6,7 +6,10 @@ use rustc_hash::FxHashMap;
|
||||||
use crate::completion::{CompletionContext, CompletionItem, CompletionKind, Completions};
|
use crate::completion::{CompletionContext, CompletionItem, CompletionKind, Completions};
|
||||||
|
|
||||||
pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) {
|
pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
if ctx.is_trivial_path {
|
if !ctx.is_trivial_path {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let names = ctx.analyzer.all_names(ctx.db);
|
let names = ctx.analyzer.all_names(ctx.db);
|
||||||
names.into_iter().for_each(|(name, res)| acc.add_resolution(ctx, name.to_string(), &res));
|
names.into_iter().for_each(|(name, res)| acc.add_resolution(ctx, name.to_string(), &res));
|
||||||
|
|
||||||
|
@ -46,7 +49,6 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_import_label(name: &str, path: &[SmolStr]) -> String {
|
fn build_import_label(name: &str, path: &[SmolStr]) -> String {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue