From 806ea03b64455a0c10fd8a8d6d98ed4e7ac15058 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 28 Nov 2018 01:22:17 +0300 Subject: drop descriptor suffix, use hir:: instead --- crates/ra_analysis/src/hir/function/mod.rs | 20 ++++++++++---------- crates/ra_analysis/src/hir/mod.rs | 2 +- crates/ra_analysis/src/hir/module/nameres.rs | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'crates/ra_analysis/src/hir') diff --git a/crates/ra_analysis/src/hir/function/mod.rs b/crates/ra_analysis/src/hir/function/mod.rs index d171b6a8d..9ca8f4e7c 100644 --- a/crates/ra_analysis/src/hir/function/mod.rs +++ b/crates/ra_analysis/src/hir/function/mod.rs @@ -25,43 +25,43 @@ impl FnId { } } -pub(crate) struct FunctionDescriptor { +pub(crate) struct Function { fn_id: FnId, } -impl FunctionDescriptor { +impl Function { pub(crate) fn guess_from_source( db: &impl HirDatabase, file_id: FileId, fn_def: ast::FnDef, - ) -> FunctionDescriptor { + ) -> Function { let fn_id = FnId::get(db, file_id, fn_def); - FunctionDescriptor { fn_id } + Function { fn_id } } pub(crate) fn guess_for_name_ref( db: &impl HirDatabase, file_id: FileId, name_ref: ast::NameRef, - ) -> Option { - FunctionDescriptor::guess_for_node(db, file_id, name_ref.syntax()) + ) -> Option { + Function::guess_for_node(db, file_id, name_ref.syntax()) } pub(crate) fn guess_for_bind_pat( db: &impl HirDatabase, file_id: FileId, bind_pat: ast::BindPat, - ) -> Option { - FunctionDescriptor::guess_for_node(db, file_id, bind_pat.syntax()) + ) -> Option { + Function::guess_for_node(db, file_id, bind_pat.syntax()) } fn guess_for_node( db: &impl HirDatabase, file_id: FileId, node: SyntaxNodeRef, - ) -> Option { + ) -> Option { let fn_def = node.ancestors().find_map(ast::FnDef::cast)?; - let res = FunctionDescriptor::guess_from_source(db, file_id, fn_def); + let res = Function::guess_from_source(db, file_id, fn_def); Some(res) } diff --git a/crates/ra_analysis/src/hir/mod.rs b/crates/ra_analysis/src/hir/mod.rs index 1de8fadcf..863ffd919 100644 --- a/crates/ra_analysis/src/hir/mod.rs +++ b/crates/ra_analysis/src/hir/mod.rs @@ -20,7 +20,7 @@ use crate::{ pub(crate) use self::{ path::{Path, PathKind}, module::{Module, ModuleId, Problem, nameres::FileItemId}, - function::{FunctionDescriptor, FnScopes}, + function::{Function, FnScopes}, }; pub use self::function::FnSignatureInfo; diff --git a/crates/ra_analysis/src/hir/module/nameres.rs b/crates/ra_analysis/src/hir/module/nameres.rs index db5d6d9c0..2ff5e0537 100644 --- a/crates/ra_analysis/src/hir/module/nameres.rs +++ b/crates/ra_analysis/src/hir/module/nameres.rs @@ -371,7 +371,7 @@ mod tests { use crate::{ AnalysisChange, mock_analysis::{MockAnalysis, analysis_and_position}, - hir::{HirDatabase, module::ModuleDescriptor}, + hir::{self, HirDatabase}, input::FilesDatabase, }; use super::*; @@ -380,7 +380,7 @@ mod tests { let (analysis, pos) = analysis_and_position(fixture); let db = analysis.imp.db; let source_root = db.file_source_root(pos.file_id); - let descr = ModuleDescriptor::guess_from_position(&*db, pos) + let descr = hir::Module::guess_from_position(&*db, pos) .unwrap() .unwrap(); let module_id = descr.module_id; -- cgit v1.2.3