diff options
author | Aleksey Kladov <[email protected]> | 2018-10-25 14:25:24 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-25 14:25:40 +0100 |
commit | 772acb53f2d7568ff1cc2ba4ca84a47110f13b3a (patch) | |
tree | d9d30baaee8b6cd13cb30c38b7c854264c15f2b2 /crates/ra_analysis | |
parent | 171acad15b1eacdfb12612a7615f4f6b21e5bf99 (diff) |
use correct file when resolving callables
Diffstat (limited to 'crates/ra_analysis')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 6c1a4749a..b24b5cfdc 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -438,9 +438,10 @@ impl AnalysisImpl { | |||
438 | 438 | ||
439 | // Resolve the function's NameRef (NOTE: this isn't entirely accurate). | 439 | // Resolve the function's NameRef (NOTE: this isn't entirely accurate). |
440 | let file_symbols = self.index_resolve(name_ref)?; | 440 | let file_symbols = self.index_resolve(name_ref)?; |
441 | for (_, fs) in file_symbols { | 441 | for (fn_fiel_id, fs) in file_symbols { |
442 | if fs.kind == FN_DEF { | 442 | if fs.kind == FN_DEF { |
443 | if let Some(fn_def) = find_node_at_offset(syntax, fs.node_range.start()) { | 443 | let fn_file = self.db.file_syntax(fn_fiel_id); |
444 | if let Some(fn_def) = find_node_at_offset(fn_file.syntax(), fs.node_range.start()) { | ||
444 | if let Some(descriptor) = FnDescriptor::new(fn_def) { | 445 | if let Some(descriptor) = FnDescriptor::new(fn_def) { |
445 | // If we have a calling expression let's find which argument we are on | 446 | // If we have a calling expression let's find which argument we are on |
446 | let mut current_parameter = None; | 447 | let mut current_parameter = None; |