aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r--crates/ra_analysis/src/imp.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 9118ed7d4..2e5853949 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -21,7 +21,7 @@ use crate::{
21 db::{self, FileSyntaxQuery, SyntaxDatabase}, 21 db::{self, FileSyntaxQuery, SyntaxDatabase},
22 hir::{ 22 hir::{
23 self, 23 self,
24 FunctionDescriptor, FnSignatureInfo, 24 FnSignatureInfo,
25 Problem, 25 Problem,
26 }, 26 },
27 input::{FilesDatabase, SourceRoot, SourceRootId, WORKSPACE}, 27 input::{FilesDatabase, SourceRoot, SourceRootId, WORKSPACE},
@@ -274,7 +274,7 @@ impl AnalysisImpl {
274 let syntax = file.syntax(); 274 let syntax = file.syntax();
275 if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(syntax, position.offset) { 275 if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(syntax, position.offset) {
276 if let Some(fn_descr) = 276 if let Some(fn_descr) =
277 FunctionDescriptor::guess_for_name_ref(&*self.db, position.file_id, name_ref) 277 hir::Function::guess_for_name_ref(&*self.db, position.file_id, name_ref)
278 { 278 {
279 let scope = fn_descr.scope(&*self.db); 279 let scope = fn_descr.scope(&*self.db);
280 // First try to resolve the symbol locally 280 // First try to resolve the symbol locally
@@ -344,14 +344,14 @@ impl AnalysisImpl {
344 db: &db::RootDatabase, 344 db: &db::RootDatabase,
345 source_file: &'a SourceFileNode, 345 source_file: &'a SourceFileNode,
346 position: FilePosition, 346 position: FilePosition,
347 ) -> Option<(ast::BindPat<'a>, FunctionDescriptor)> { 347 ) -> Option<(ast::BindPat<'a>, hir::Function)> {
348 let syntax = source_file.syntax(); 348 let syntax = source_file.syntax();
349 if let Some(binding) = find_node_at_offset::<ast::BindPat>(syntax, position.offset) { 349 if let Some(binding) = find_node_at_offset::<ast::BindPat>(syntax, position.offset) {
350 let descr = FunctionDescriptor::guess_for_bind_pat(db, position.file_id, binding)?; 350 let descr = hir::Function::guess_for_bind_pat(db, position.file_id, binding)?;
351 return Some((binding, descr)); 351 return Some((binding, descr));
352 }; 352 };
353 let name_ref = find_node_at_offset::<ast::NameRef>(syntax, position.offset)?; 353 let name_ref = find_node_at_offset::<ast::NameRef>(syntax, position.offset)?;
354 let descr = FunctionDescriptor::guess_for_name_ref(db, position.file_id, name_ref)?; 354 let descr = hir::Function::guess_for_name_ref(db, position.file_id, name_ref)?;
355 let scope = descr.scope(db); 355 let scope = descr.scope(db);
356 let resolved = scope.resolve_local_name(name_ref)?; 356 let resolved = scope.resolve_local_name(name_ref)?;
357 let resolved = resolved.ptr().resolve(source_file); 357 let resolved = resolved.ptr().resolve(source_file);
@@ -472,8 +472,7 @@ impl AnalysisImpl {
472 if fs.kind == FN_DEF { 472 if fs.kind == FN_DEF {
473 let fn_file = self.db.file_syntax(fn_file_id); 473 let fn_file = self.db.file_syntax(fn_file_id);
474 if let Some(fn_def) = find_node_at_offset(fn_file.syntax(), fs.node_range.start()) { 474 if let Some(fn_def) = find_node_at_offset(fn_file.syntax(), fs.node_range.start()) {
475 let descr = 475 let descr = hir::Function::guess_from_source(&*self.db, fn_file_id, fn_def);
476 FunctionDescriptor::guess_from_source(&*self.db, fn_file_id, fn_def);
477 if let Some(descriptor) = descr.signature_info(&*self.db) { 476 if let Some(descriptor) = descr.signature_info(&*self.db) {
478 // If we have a calling expression let's find which argument we are on 477 // If we have a calling expression let's find which argument we are on
479 let mut current_parameter = None; 478 let mut current_parameter = None;