aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2018-12-23 11:15:46 +0000
committerFlorian Diebold <[email protected]>2018-12-23 12:48:04 +0000
commit515c3bc59bfc227cbbb82f80b53c5c125be4fc30 (patch)
treec4087228b2443a562c60906306f5a1385fb6968d /crates/ra_analysis
parent7348f7883fa2bd571fff036c82e98c102d05c362 (diff)
Cleanup
Diffstat (limited to 'crates/ra_analysis')
-rw-r--r--crates/ra_analysis/src/imp.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 4e0631679..f2912d235 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -516,8 +516,14 @@ impl AnalysisImpl {
516 let syntax = file.syntax(); 516 let syntax = file.syntax();
517 let node = find_covering_node(syntax, range); 517 let node = find_covering_node(syntax, range);
518 let parent_fn = node.ancestors().filter_map(FnDef::cast).next(); 518 let parent_fn = node.ancestors().filter_map(FnDef::cast).next();
519 let parent_fn = if let Some(p) = parent_fn { p } else { return Ok(None) }; 519 let parent_fn = if let Some(p) = parent_fn {
520 let function = ctry!(source_binder::function_from_source(&*self.db, file_id, parent_fn)?); 520 p
521 } else {
522 return Ok(None);
523 };
524 let function = ctry!(source_binder::function_from_source(
525 &*self.db, file_id, parent_fn
526 )?);
521 let infer = function.infer(&*self.db); 527 let infer = function.infer(&*self.db);
522 Ok(infer.type_of_node(node).map(|t| t.to_string())) 528 Ok(infer.type_of_node(node).map(|t| t.to_string()))
523 } 529 }