mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Cleanup
This commit is contained in:
parent
7348f7883f
commit
515c3bc59b
4 changed files with 110 additions and 108 deletions
|
@ -516,8 +516,14 @@ impl AnalysisImpl {
|
|||
let syntax = file.syntax();
|
||||
let node = find_covering_node(syntax, range);
|
||||
let parent_fn = node.ancestors().filter_map(FnDef::cast).next();
|
||||
let parent_fn = if let Some(p) = parent_fn { p } else { return Ok(None) };
|
||||
let function = ctry!(source_binder::function_from_source(&*self.db, file_id, parent_fn)?);
|
||||
let parent_fn = if let Some(p) = parent_fn {
|
||||
p
|
||||
} else {
|
||||
return Ok(None);
|
||||
};
|
||||
let function = ctry!(source_binder::function_from_source(
|
||||
&*self.db, file_id, parent_fn
|
||||
)?);
|
||||
let infer = function.infer(&*self.db);
|
||||
Ok(infer.type_of_node(node).map(|t| t.to_string()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue