diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-15 16:20:31 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-15 16:20:31 +0000 |
commit | 323938dae58576f5fa86ddebf88fdcb5b09662ed (patch) | |
tree | dfeae99da99f6f9b2d91d31f84c0a3b527cfffbe /crates/ra_ide_api/src | |
parent | 72a4951023f11adfdf0eac353c99d8a01a9471fc (diff) | |
parent | fafcd103d26821a8408572514201a40765bb2d2b (diff) |
Merge #555
555: remove Cancelable from ids r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_scope.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/goto_definition.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 207a509b3..42468681a 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -8,13 +8,13 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> C | |||
8 | (Some(path), Some(module)) => (path.clone(), module), | 8 | (Some(path), Some(module)) => (path.clone(), module), |
9 | _ => return Ok(()), | 9 | _ => return Ok(()), |
10 | }; | 10 | }; |
11 | let def_id = match module.resolve_path(ctx.db, &path)?.take_types() { | 11 | let def_id = match module.resolve_path(ctx.db, &path).take_types() { |
12 | Some(it) => it, | 12 | Some(it) => it, |
13 | None => return Ok(()), | 13 | None => return Ok(()), |
14 | }; | 14 | }; |
15 | match def_id.resolve(ctx.db) { | 15 | match def_id.resolve(ctx.db) { |
16 | hir::Def::Module(module) => { | 16 | hir::Def::Module(module) => { |
17 | let module_scope = module.scope(ctx.db)?; | 17 | let module_scope = module.scope(ctx.db); |
18 | for (name, res) in module_scope.entries() { | 18 | for (name, res) in module_scope.entries() { |
19 | CompletionItem::new(CompletionKind::Reference, name.to_string()) | 19 | CompletionItem::new(CompletionKind::Reference, name.to_string()) |
20 | .from_resolution(ctx, res) | 20 | .from_resolution(ctx, res) |
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index fdb64895e..660c7d16e 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs | |||
@@ -19,7 +19,7 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) -> | |||
19 | complete_fn(acc, &scopes, ctx.offset); | 19 | complete_fn(acc, &scopes, ctx.offset); |
20 | } | 20 | } |
21 | 21 | ||
22 | let module_scope = module.scope(ctx.db)?; | 22 | let module_scope = module.scope(ctx.db); |
23 | let (file_id, _) = module.definition_source(ctx.db); | 23 | let (file_id, _) = module.definition_source(ctx.db); |
24 | module_scope | 24 | module_scope |
25 | .entries() | 25 | .entries() |
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 5d522181b..cdd8e211d 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs | |||
@@ -85,7 +85,7 @@ pub(crate) fn reference_definition( | |||
85 | .find_map(ast::Path::cast) | 85 | .find_map(ast::Path::cast) |
86 | .and_then(hir::Path::from_ast) | 86 | .and_then(hir::Path::from_ast) |
87 | { | 87 | { |
88 | let resolved = module.resolve_path(db, &path)?; | 88 | let resolved = module.resolve_path(db, &path); |
89 | if let Some(def_id) = resolved.take_types().or(resolved.take_values()) { | 89 | if let Some(def_id) = resolved.take_types().or(resolved.take_values()) { |
90 | if let Some(target) = NavigationTarget::from_def(db, def_id.resolve(db)) { | 90 | if let Some(target) = NavigationTarget::from_def(db, def_id.resolve(db)) { |
91 | return Ok(Exact(target)); | 91 | return Ok(Exact(target)); |