hide resolver

This commit is contained in:
Aleksey Kladov 2019-04-13 11:00:15 +03:00
parent f4a94e74bc
commit 62d01dd4df
4 changed files with 17 additions and 9 deletions

View file

@ -9,7 +9,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
Some(path) => path.clone(),
_ => return,
};
let def = match ctx.analyzer.resolver().resolve_path(ctx.db, &path).take_types() {
let def = match ctx.analyzer.resolve_hir_path(ctx.db, &path).take_types() {
Some(Resolution::Def(def)) => def,
_ => return,
};

View file

@ -7,7 +7,7 @@ pub(super) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) {
}
// FIXME: ideally, we should look at the type we are matching against and
// suggest variants + auto-imports
let names = ctx.analyzer.resolver().all_names(ctx.db);
let names = ctx.analyzer.all_names(ctx.db);
for (name, res) in names.into_iter() {
let r = res.as_ref();
let def = match r.take_types().or(r.take_values()) {

View file

@ -4,7 +4,7 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) {
if !ctx.is_trivial_path {
return;
}
let names = ctx.analyzer.resolver().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));
}