1783: simplify r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-09-06 18:57:32 +00:00 committed by GitHub
commit a73b424e3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,10 @@ use rustc_hash::FxHashMap;
use crate::completion::{CompletionContext, CompletionItem, CompletionKind, Completions};
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);
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 {
let mut buf = String::with_capacity(64);