From 36b1d20c1661877c0c5a55ccd07522bc97bfc254 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 28 Nov 2018 01:19:55 +0300 Subject: rename ModuleDescriptor -> Module --- crates/ra_analysis/src/imp.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crates/ra_analysis/src/imp.rs') 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::{ completion::{completions, CompletionItem}, db::{self, FileSyntaxQuery, SyntaxDatabase}, hir::{ - FunctionDescriptor, FnSignatureInfo, ModuleDescriptor, + self, + FunctionDescriptor, FnSignatureInfo, Problem, }, input::{FilesDatabase, SourceRoot, SourceRootId, WORKSPACE}, @@ -226,7 +227,7 @@ impl AnalysisImpl { /// This return `Vec`: a module may be included from several places. We /// don't handle this case yet though, so the Vec has length at most one. pub fn parent_module(&self, position: FilePosition) -> Cancelable> { - let descr = match ModuleDescriptor::guess_from_position(&*self.db, position)? { + let descr = match hir::Module::guess_from_position(&*self.db, position)? { None => return Ok(Vec::new()), Some(it) => it, }; @@ -245,7 +246,7 @@ impl AnalysisImpl { } /// Returns `Vec` for the same reason as `parent_module` pub fn crate_for(&self, file_id: FileId) -> Cancelable> { - let descr = match ModuleDescriptor::guess_from_file_id(&*self.db, file_id)? { + let descr = match hir::Module::guess_from_file_id(&*self.db, file_id)? { None => return Ok(Vec::new()), Some(it) => it, }; @@ -298,7 +299,7 @@ impl AnalysisImpl { if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) { if module.has_semi() { let parent_module = - ModuleDescriptor::guess_from_file_id(&*self.db, position.file_id)?; + hir::Module::guess_from_file_id(&*self.db, position.file_id)?; let child_name = module.name(); match (parent_module, child_name) { (Some(parent_module), Some(child_name)) => { @@ -380,7 +381,7 @@ impl AnalysisImpl { fix: None, }) .collect::>(); - if let Some(m) = ModuleDescriptor::guess_from_file_id(&*self.db, file_id)? { + if let Some(m) = hir::Module::guess_from_file_id(&*self.db, file_id)? { for (name_node, problem) in m.problems(&*self.db) { let diag = match problem { Problem::UnresolvedModule { candidate } => { -- cgit v1.2.3