mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 14:33:29 +00:00
simplify
This commit is contained in:
parent
219287a14c
commit
6c11935712
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));
|
||||||
|
|
||||||
|
@ -47,7 +50,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 {
|
||||||
let mut buf = String::with_capacity(64);
|
let mut buf = String::with_capacity(64);
|
||||||
|
|
Loading…
Reference in a new issue