diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_scope.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/navigation_target.rs | 8 | ||||
-rw-r--r-- | crates/ra_ide_api/src/runnables.rs | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index 770a0fdf2..f422bb9a7 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs | |||
@@ -20,7 +20,7 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) -> | |||
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() |
26 | .filter(|(_name, res)| { | 26 | .filter(|(_name, res)| { |
diff --git a/crates/ra_ide_api/src/navigation_target.rs b/crates/ra_ide_api/src/navigation_target.rs index 230d0f67a..7562b9a1f 100644 --- a/crates/ra_ide_api/src/navigation_target.rs +++ b/crates/ra_ide_api/src/navigation_target.rs | |||
@@ -73,9 +73,9 @@ impl NavigationTarget { | |||
73 | db: &RootDatabase, | 73 | db: &RootDatabase, |
74 | module: hir::Module, | 74 | module: hir::Module, |
75 | ) -> Cancelable<NavigationTarget> { | 75 | ) -> Cancelable<NavigationTarget> { |
76 | let (file_id, source) = module.definition_source(db)?; | 76 | let (file_id, source) = module.definition_source(db); |
77 | let name = module | 77 | let name = module |
78 | .name(db)? | 78 | .name(db) |
79 | .map(|it| it.to_string().into()) | 79 | .map(|it| it.to_string().into()) |
80 | .unwrap_or_default(); | 80 | .unwrap_or_default(); |
81 | let res = match source { | 81 | let res = match source { |
@@ -94,10 +94,10 @@ impl NavigationTarget { | |||
94 | module: hir::Module, | 94 | module: hir::Module, |
95 | ) -> Cancelable<NavigationTarget> { | 95 | ) -> Cancelable<NavigationTarget> { |
96 | let name = module | 96 | let name = module |
97 | .name(db)? | 97 | .name(db) |
98 | .map(|it| it.to_string().into()) | 98 | .map(|it| it.to_string().into()) |
99 | .unwrap_or_default(); | 99 | .unwrap_or_default(); |
100 | if let Some((file_id, source)) = module.declaration_source(db)? { | 100 | if let Some((file_id, source)) = module.declaration_source(db) { |
101 | return Ok(NavigationTarget::from_syntax( | 101 | return Ok(NavigationTarget::from_syntax( |
102 | file_id, | 102 | file_id, |
103 | name, | 103 | name, |
diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide_api/src/runnables.rs index 9fa0f79a6..c0d4bda94 100644 --- a/crates/ra_ide_api/src/runnables.rs +++ b/crates/ra_ide_api/src/runnables.rs | |||
@@ -83,8 +83,7 @@ fn runnable_mod(db: &RootDatabase, file_id: FileId, module: &ast::Module) -> Opt | |||
83 | .ok()? | 83 | .ok()? |
84 | .into_iter() | 84 | .into_iter() |
85 | .rev() | 85 | .rev() |
86 | .filter_map(|it| it.name(db).ok()) | 86 | .filter_map(|it| it.name(db)) |
87 | .filter_map(|it| it) | ||
88 | .join("::"); | 87 | .join("::"); |
89 | Some(Runnable { | 88 | Some(Runnable { |
90 | range, | 89 | range, |