mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
use ctry
This commit is contained in:
parent
f4860870da
commit
aa7fd563a4
4 changed files with 13 additions and 22 deletions
|
@ -450,14 +450,8 @@ impl AnalysisImpl {
|
|||
let syntax = file.syntax();
|
||||
|
||||
// Find the calling expression and it's NameRef
|
||||
let calling_node = match FnCallNode::with_node(syntax, position.offset) {
|
||||
Some(node) => node,
|
||||
None => return Ok(None),
|
||||
};
|
||||
let name_ref = match calling_node.name_ref() {
|
||||
Some(name) => name,
|
||||
None => return Ok(None),
|
||||
};
|
||||
let calling_node = ctry!(FnCallNode::with_node(syntax, position.offset));
|
||||
let name_ref = ctry!(calling_node.name_ref());
|
||||
|
||||
// Resolve the function's NameRef (NOTE: this isn't entirely accurate).
|
||||
let file_symbols = self.index_resolve(name_ref)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue