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.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 377f7420f..9118ed7d4 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -20,7 +20,8 @@ use crate::{
20 completion::{completions, CompletionItem}, 20 completion::{completions, CompletionItem},
21 db::{self, FileSyntaxQuery, SyntaxDatabase}, 21 db::{self, FileSyntaxQuery, SyntaxDatabase},
22 hir::{ 22 hir::{
23 FunctionDescriptor, FnSignatureInfo, ModuleDescriptor, 23 self,
24 FunctionDescriptor, FnSignatureInfo,
24 Problem, 25 Problem,
25 }, 26 },
26 input::{FilesDatabase, SourceRoot, SourceRootId, WORKSPACE}, 27 input::{FilesDatabase, SourceRoot, SourceRootId, WORKSPACE},
@@ -226,7 +227,7 @@ impl AnalysisImpl {
226 /// This return `Vec`: a module may be included from several places. We 227 /// This return `Vec`: a module may be included from several places. We
227 /// don't handle this case yet though, so the Vec has length at most one. 228 /// don't handle this case yet though, so the Vec has length at most one.
228 pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<(FileId, FileSymbol)>> { 229 pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<(FileId, FileSymbol)>> {
229 let descr = match ModuleDescriptor::guess_from_position(&*self.db, position)? { 230 let descr = match hir::Module::guess_from_position(&*self.db, position)? {
230 None => return Ok(Vec::new()), 231 None => return Ok(Vec::new()),
231 Some(it) => it, 232 Some(it) => it,
232 }; 233 };
@@ -245,7 +246,7 @@ impl AnalysisImpl {
245 } 246 }
246 /// Returns `Vec` for the same reason as `parent_module` 247 /// Returns `Vec` for the same reason as `parent_module`
247 pub fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { 248 pub fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> {
248 let descr = match ModuleDescriptor::guess_from_file_id(&*self.db, file_id)? { 249 let descr = match hir::Module::guess_from_file_id(&*self.db, file_id)? {
249 None => return Ok(Vec::new()), 250 None => return Ok(Vec::new()),
250 Some(it) => it, 251 Some(it) => it,
251 }; 252 };
@@ -298,7 +299,7 @@ impl AnalysisImpl {
298 if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) { 299 if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) {
299 if module.has_semi() { 300 if module.has_semi() {
300 let parent_module = 301 let parent_module =
301 ModuleDescriptor::guess_from_file_id(&*self.db, position.file_id)?; 302 hir::Module::guess_from_file_id(&*self.db, position.file_id)?;
302 let child_name = module.name(); 303 let child_name = module.name();
303 match (parent_module, child_name) { 304 match (parent_module, child_name) {
304 (Some(parent_module), Some(child_name)) => { 305 (Some(parent_module), Some(child_name)) => {
@@ -380,7 +381,7 @@ impl AnalysisImpl {
380 fix: None, 381 fix: None,
381 }) 382 })
382 .collect::<Vec<_>>(); 383 .collect::<Vec<_>>();
383 if let Some(m) = ModuleDescriptor::guess_from_file_id(&*self.db, file_id)? { 384 if let Some(m) = hir::Module::guess_from_file_id(&*self.db, file_id)? {
384 for (name_node, problem) in m.problems(&*self.db) { 385 for (name_node, problem) in m.problems(&*self.db) {
385 let diag = match problem { 386 let diag = match problem {
386 Problem::UnresolvedModule { candidate } => { 387 Problem::UnresolvedModule { candidate } => {