New krate() method in Resolver.

Renamed Impl to ImplBlock.
This commit is contained in:
Marco Groppo 2019-04-17 23:40:00 +02:00
parent e85ee60c42
commit 8ebb20edce
5 changed files with 49 additions and 59 deletions

View file

@ -39,7 +39,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
hir::ModuleDef::Struct(s) => {
let ty = s.ty(ctx.db);
let krate = ctx.module.and_then(|m| m.krate(ctx.db));
krate.map_or((), |krate| {
if let Some(krate) = krate {
ty.iterate_impl_items(ctx.db, krate, |item| {
match item {
hir::ImplItem::Method(func) => {
@ -53,7 +53,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
}
None::<()>
});
});
}
}
_ => return,
};