diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/add_missing_impl_members.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_assists/src/add_missing_impl_members.rs b/crates/ra_assists/src/add_missing_impl_members.rs index 5000d0122..e682ca055 100644 --- a/crates/ra_assists/src/add_missing_impl_members.rs +++ b/crates/ra_assists/src/add_missing_impl_members.rs | |||
@@ -49,13 +49,10 @@ pub(crate) fn add_missing_impl_members(mut ctx: AssistCtx<impl HirDatabase>) -> | |||
49 | } | 49 | } |
50 | 50 | ||
51 | let trait_def = { | 51 | let trait_def = { |
52 | let db = ctx.db; | 52 | let position = FilePosition { file_id: ctx.frange.file_id, offset: node.range().end() }; |
53 | // TODO: Can we get the position of cursor itself rather than supplied range? | 53 | let resolver = hir::source_binder::resolver_for_position(ctx.db, position); |
54 | let range = ctx.frange; | ||
55 | let position = FilePosition { file_id: range.file_id, offset: range.range.start() }; | ||
56 | let resolver = hir::source_binder::resolver_for_position(db, position); | ||
57 | 54 | ||
58 | resolve_target_trait_def(db, &resolver, impl_node)? | 55 | resolve_target_trait_def(ctx.db, &resolver, impl_node)? |
59 | }; | 56 | }; |
60 | 57 | ||
61 | let fn_def_opt = |kind| if let ImplItemKind::FnDef(def) = kind { Some(def) } else { None }; | 58 | let fn_def_opt = |kind| if let ImplItemKind::FnDef(def) = kind { Some(def) } else { None }; |