diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_context.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index 5d1851da6..8abab0221 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs | |||
@@ -130,12 +130,9 @@ impl<'a> CompletionContext<'a> { | |||
130 | .ancestors() | 130 | .ancestors() |
131 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) | 131 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) |
132 | .find_map(ast::FnDef::cast); | 132 | .find_map(ast::FnDef::cast); |
133 | match (self.module, self.function_syntax) { | 133 | if let (Some(module), Some(fn_def)) = (self.module, self.function_syntax) { |
134 | (Some(module), Some(fn_def)) => { | 134 | let function = source_binder::function_from_module(self.db, module, fn_def); |
135 | let function = source_binder::function_from_module(self.db, module, fn_def); | 135 | self.function = Some(function); |
136 | self.function = Some(function); | ||
137 | } | ||
138 | _ => (), | ||
139 | } | 136 | } |
140 | 137 | ||
141 | let parent = match name_ref.syntax().parent() { | 138 | let parent = match name_ref.syntax().parent() { |