From 98baa9b569b49162392ed4149dd435854fe941b8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:22:05 +0200 Subject: Rename ra_arena --- crates/ra_hir_def/Cargo.toml | 2 +- crates/ra_hir_def/src/adt.rs | 2 +- crates/ra_hir_def/src/body.rs | 2 +- crates/ra_hir_def/src/body/lower.rs | 2 +- crates/ra_hir_def/src/body/scope.rs | 2 +- crates/ra_hir_def/src/expr.rs | 2 +- crates/ra_hir_def/src/generics.rs | 2 +- crates/ra_hir_def/src/item_tree.rs | 2 +- crates/ra_hir_def/src/item_tree/lower.rs | 2 +- crates/ra_hir_def/src/lib.rs | 2 +- crates/ra_hir_def/src/nameres.rs | 2 +- crates/ra_hir_def/src/nameres/collector.rs | 2 +- crates/ra_hir_def/src/src.rs | 2 +- crates/ra_hir_def/src/trace.rs | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml index d96a86b80..6dd6fdde6 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/ra_hir_def/Cargo.toml @@ -22,7 +22,7 @@ smallvec = "1.4.0" stdx = { path = "../stdx" } -ra_arena = { path = "../ra_arena" } +arena = { path = "../arena" } ra_db = { path = "../ra_db" } ra_syntax = { path = "../ra_syntax" } ra_prof = { path = "../ra_prof" } diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 35c3a9140..896a69ca8 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs @@ -2,12 +2,12 @@ use std::sync::Arc; +use arena::{map::ArenaMap, Arena}; use either::Either; use hir_expand::{ name::{AsName, Name}, InFile, }; -use ra_arena::{map::ArenaMap, Arena}; use ra_syntax::ast::{self, NameOwner, VisibilityOwner}; use tt::{Delimiter, DelimiterKind, Leaf, Subtree, TokenTree}; diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index d5f18b920..cb178655b 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -5,10 +5,10 @@ pub mod scope; use std::{mem, ops::Index, sync::Arc}; +use arena::{map::ArenaMap, Arena}; use drop_bomb::DropBomb; use either::Either; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; -use ra_arena::{map::ArenaMap, Arena}; use ra_cfg::CfgOptions; use ra_db::CrateId; use ra_prof::profile; diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index f5c37edb3..482393006 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -3,13 +3,13 @@ use std::{any::type_name, sync::Arc}; +use arena::Arena; use either::Either; use hir_expand::{ hygiene::Hygiene, name::{name, AsName, Name}, HirFileId, MacroDefId, MacroDefKind, }; -use ra_arena::Arena; use ra_syntax::{ ast::{ self, ArgListOwner, ArrayExprKind, AstChildren, LiteralKind, LoopBodyOwner, NameOwner, diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index 99e876683..f783e18b5 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs @@ -1,8 +1,8 @@ //! Name resolution for expressions. use std::sync::Arc; +use arena::{Arena, Idx}; use hir_expand::name::Name; -use ra_arena::{Arena, Idx}; use rustc_hash::FxHashMap; use crate::{ diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index e41cfc16b..befe41c2a 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs @@ -12,8 +12,8 @@ //! //! See also a neighboring `body` module. +use arena::{Idx, RawId}; use hir_expand::name::Name; -use ra_arena::{Idx, RawId}; use ra_syntax::ast::RangeOp; use crate::{ diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs index 699ba9c92..90daa46b4 100644 --- a/crates/ra_hir_def/src/generics.rs +++ b/crates/ra_hir_def/src/generics.rs @@ -4,12 +4,12 @@ //! in rustc. use std::sync::Arc; +use arena::{map::ArenaMap, Arena}; use either::Either; use hir_expand::{ name::{name, AsName, Name}, InFile, }; -use ra_arena::{map::ArenaMap, Arena}; use ra_db::FileId; use ra_prof::profile; use ra_syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index a67e75dac..fc05bb307 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -13,6 +13,7 @@ use std::{ sync::Arc, }; +use arena::{Arena, Idx, RawId}; use ast::{AstNode, AttrsOwner, NameOwner, StructKind}; use either::Either; use hir_expand::{ @@ -21,7 +22,6 @@ use hir_expand::{ name::{name, AsName, Name}, HirFileId, InFile, }; -use ra_arena::{Arena, Idx, RawId}; use ra_syntax::{ast, match_ast}; use rustc_hash::FxHashMap; use smallvec::SmallVec; diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 450ef8798..4523d0fbb 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs @@ -2,8 +2,8 @@ use std::{collections::hash_map::Entry, mem, sync::Arc}; +use arena::map::ArenaMap; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, HirFileId}; -use ra_arena::map::ArenaMap; use ra_syntax::{ ast::{self, ModuleItemOwner}, SyntaxNode, diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 237b1038a..810393739 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs @@ -52,11 +52,11 @@ mod test_db; use std::hash::{Hash, Hasher}; +use arena::Idx; use hir_expand::{ ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, }; -use ra_arena::Idx; use ra_db::{impl_intern_key, salsa, CrateId}; use ra_syntax::ast; diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index 3d9b55a73..b4b97eb08 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs @@ -56,8 +56,8 @@ mod tests; use std::sync::Arc; +use arena::Arena; use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; -use ra_arena::Arena; use ra_db::{CrateId, Edition, FileId}; use ra_prof::profile; use ra_syntax::ast; diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 28b7a20c5..52ee401d9 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -1208,7 +1208,7 @@ fn is_macro_rules(path: &ModPath) -> bool { #[cfg(test)] mod tests { use crate::{db::DefDatabase, test_db::TestDB}; - use ra_arena::Arena; + use arena::Arena; use ra_db::{fixture::WithFixture, SourceDatabase}; use super::*; diff --git a/crates/ra_hir_def/src/src.rs b/crates/ra_hir_def/src/src.rs index 043b93fad..7a79b0314 100644 --- a/crates/ra_hir_def/src/src.rs +++ b/crates/ra_hir_def/src/src.rs @@ -1,7 +1,7 @@ //! Utilities for mapping between hir IDs and the surface syntax. +use arena::map::ArenaMap; use hir_expand::InFile; -use ra_arena::map::ArenaMap; use crate::{db::DefDatabase, item_tree::ItemTreeNode, AssocItemLoc, ItemLoc}; diff --git a/crates/ra_hir_def/src/trace.rs b/crates/ra_hir_def/src/trace.rs index ced07577d..fd64e7018 100644 --- a/crates/ra_hir_def/src/trace.rs +++ b/crates/ra_hir_def/src/trace.rs @@ -9,7 +9,7 @@ //! absolute offsets. The `Trace` structure (inspired, at least in name, by //! Kotlin's `BindingTrace`) allows use the same code to compute both //! projections. -use ra_arena::{map::ArenaMap, Arena, Idx, RawId}; +use arena::{map::ArenaMap, Arena, Idx, RawId}; pub(crate) struct Trace { arena: Option>, -- cgit v1.2.3 From 208b7bd7ba687fb570feb1b89219f14c63712ce8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:32:36 +0200 Subject: Rename ra_prof -> profile --- crates/ra_hir_def/Cargo.toml | 2 +- crates/ra_hir_def/src/body.rs | 3 +-- crates/ra_hir_def/src/data.rs | 3 +-- crates/ra_hir_def/src/db.rs | 3 +-- crates/ra_hir_def/src/find_path.rs | 5 ++--- crates/ra_hir_def/src/generics.rs | 3 +-- crates/ra_hir_def/src/import_map.rs | 4 ++-- crates/ra_hir_def/src/item_tree.rs | 2 +- crates/ra_hir_def/src/lang_item.rs | 7 +++---- crates/ra_hir_def/src/nameres.rs | 3 +-- 10 files changed, 14 insertions(+), 21 deletions(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml index 6dd6fdde6..adfd8c7b7 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/ra_hir_def/Cargo.toml @@ -25,7 +25,7 @@ stdx = { path = "../stdx" } arena = { path = "../arena" } ra_db = { path = "../ra_db" } ra_syntax = { path = "../ra_syntax" } -ra_prof = { path = "../ra_prof" } +profile = { path = "../profile" } hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } test_utils = { path = "../test_utils" } mbe = { path = "../ra_mbe", package = "ra_mbe" } diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index cb178655b..1deb1a837 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -11,7 +11,6 @@ use either::Either; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; use ra_cfg::CfgOptions; use ra_db::CrateId; -use ra_prof::profile; use ra_syntax::{ast, AstNode, AstPtr}; use rustc_hash::FxHashMap; use test_utils::mark; @@ -228,7 +227,7 @@ impl Body { db: &dyn DefDatabase, def: DefWithBodyId, ) -> (Arc, Arc) { - let _p = profile("body_with_source_map_query"); + let _p = profile::span("body_with_source_map_query"); let mut params = None; let (file_id, module, body) = match def { diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 88a8ef9bf..758c12f33 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs @@ -3,7 +3,6 @@ use std::sync::Arc; use hir_expand::{name::Name, InFile}; -use ra_prof::profile; use ra_syntax::ast; use crate::{ @@ -133,7 +132,7 @@ pub struct ImplData { impl ImplData { pub(crate) fn impl_data_query(db: &dyn DefDatabase, id: ImplId) -> Arc { - let _p = profile("impl_data_query"); + let _p = profile::span("impl_data_query"); let impl_loc = id.lookup(db); let item_tree = db.item_tree(impl_loc.id.file_id); diff --git a/crates/ra_hir_def/src/db.rs b/crates/ra_hir_def/src/db.rs index 9c3ede2d7..1dd4197f8 100644 --- a/crates/ra_hir_def/src/db.rs +++ b/crates/ra_hir_def/src/db.rs @@ -3,7 +3,6 @@ use std::sync::Arc; use hir_expand::{db::AstDatabase, HirFileId}; use ra_db::{salsa, CrateId, SourceDatabase, Upcast}; -use ra_prof::profile; use ra_syntax::SmolStr; use crate::{ @@ -116,6 +115,6 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast { } fn crate_def_map_wait(db: &impl DefDatabase, krate: CrateId) -> Arc { - let _p = profile("crate_def_map:wait"); + let _p = profile::span("crate_def_map:wait"); db.crate_def_map_query(krate) } diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs index 06701a830..46e70eb48 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/ra_hir_def/src/find_path.rs @@ -1,7 +1,6 @@ //! An algorithm to find a path to refer to a certain item. use hir_expand::name::{known, AsName, Name}; -use ra_prof::profile; use rustc_hash::FxHashSet; use test_utils::mark; @@ -18,7 +17,7 @@ use crate::{ /// Find a path that can be used to refer to a certain item. This can depend on /// *from where* you're referring to the item, hence the `from` parameter. pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option { - let _p = profile("find_path"); + let _p = profile::span("find_path"); find_path_inner(db, item, from, MAX_PATH_LEN) } @@ -215,7 +214,7 @@ fn find_local_import_locations( item: ItemInNs, from: ModuleId, ) -> Vec<(ModuleId, Name)> { - let _p = profile("find_local_import_locations"); + let _p = profile::span("find_local_import_locations"); // `from` can import anything below `from` with visibility of at least `from`, and anything // above `from` with any visibility. That means we do not need to descend into private siblings diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs index 90daa46b4..0e06a0b12 100644 --- a/crates/ra_hir_def/src/generics.rs +++ b/crates/ra_hir_def/src/generics.rs @@ -11,7 +11,6 @@ use hir_expand::{ InFile, }; use ra_db::FileId; -use ra_prof::profile; use ra_syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner}; use crate::{ @@ -73,7 +72,7 @@ impl GenericParams { db: &dyn DefDatabase, def: GenericDefId, ) -> Arc { - let _p = profile("generic_params_query"); + let _p = profile::span("generic_params_query"); let generics = match def { GenericDefId::FunctionId(id) => { diff --git a/crates/ra_hir_def/src/import_map.rs b/crates/ra_hir_def/src/import_map.rs index 9e4c30b1a..3a9eec887 100644 --- a/crates/ra_hir_def/src/import_map.rs +++ b/crates/ra_hir_def/src/import_map.rs @@ -56,7 +56,7 @@ pub struct ImportMap { impl ImportMap { pub fn import_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc { - let _p = ra_prof::profile("import_map_query"); + let _p = profile::span("import_map_query"); let def_map = db.crate_def_map(krate); let mut import_map = Self::default(); @@ -254,7 +254,7 @@ pub fn search_dependencies<'a>( krate: CrateId, query: Query, ) -> Vec { - let _p = ra_prof::profile("search_dependencies").detail(|| format!("{:?}", query)); + let _p = profile::span("search_dependencies").detail(|| format!("{:?}", query)); let graph = db.crate_graph(); let import_maps: Vec<_> = diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index fc05bb307..104966c7f 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -77,7 +77,7 @@ pub struct ItemTree { impl ItemTree { pub fn item_tree_query(db: &dyn DefDatabase, file_id: HirFileId) -> Arc { - let _p = ra_prof::profile("item_tree_query").detail(|| format!("{:?}", file_id)); + let _p = profile::span("item_tree_query").detail(|| format!("{:?}", file_id)); let syntax = if let Some(node) = db.parse_or_expand(file_id) { node } else { diff --git a/crates/ra_hir_def/src/lang_item.rs b/crates/ra_hir_def/src/lang_item.rs index 3516784b8..3631499bf 100644 --- a/crates/ra_hir_def/src/lang_item.rs +++ b/crates/ra_hir_def/src/lang_item.rs @@ -4,7 +4,6 @@ //! features, such as Fn family of traits. use std::sync::Arc; -use ra_prof::profile; use ra_syntax::SmolStr; use rustc_hash::FxHashMap; @@ -79,7 +78,7 @@ impl LangItems { /// Salsa query. This will look for lang items in a specific crate. pub(crate) fn crate_lang_items_query(db: &dyn DefDatabase, krate: CrateId) -> Arc { - let _p = profile("crate_lang_items_query"); + let _p = profile::span("crate_lang_items_query"); let mut lang_items = LangItems::default(); @@ -98,7 +97,7 @@ impl LangItems { db: &dyn DefDatabase, module: ModuleId, ) -> Option> { - let _p = profile("module_lang_items_query"); + let _p = profile::span("module_lang_items_query"); let mut lang_items = LangItems::default(); lang_items.collect_lang_items(db, module); if lang_items.items.is_empty() { @@ -115,7 +114,7 @@ impl LangItems { start_crate: CrateId, item: SmolStr, ) -> Option { - let _p = profile("lang_item_query"); + let _p = profile::span("lang_item_query"); let lang_items = db.crate_lang_items(start_crate); let start_crate_target = lang_items.items.get(&item); if let Some(target) = start_crate_target { diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index b4b97eb08..dc239997f 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs @@ -59,7 +59,6 @@ use std::sync::Arc; use arena::Arena; use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile}; use ra_db::{CrateId, Edition, FileId}; -use ra_prof::profile; use ra_syntax::ast; use rustc_hash::FxHashMap; use stdx::format_to; @@ -172,7 +171,7 @@ pub struct ModuleData { impl CrateDefMap { pub(crate) fn crate_def_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc { - let _p = profile("crate_def_map_query").detail(|| { + let _p = profile::span("crate_def_map_query").detail(|| { db.crate_graph()[krate] .display_name .as_ref() -- cgit v1.2.3