From 90bc832b22aefb2a382b3465793df7e528351aa1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 27 Nov 2018 23:05:33 +0300 Subject: remove underscores --- crates/ra_analysis/src/hir/db.rs | 14 +++++++------- crates/ra_analysis/src/hir/function/imp.rs | 2 +- crates/ra_analysis/src/hir/module/imp.rs | 2 +- crates/ra_analysis/src/hir/module/mod.rs | 6 +++--- crates/ra_analysis/src/hir/module/nameres.rs | 20 ++++++++++---------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/crates/ra_analysis/src/hir/db.rs b/crates/ra_analysis/src/hir/db.rs index 3cdf8e6d6..498a5c2dd 100644 --- a/crates/ra_analysis/src/hir/db.rs +++ b/crates/ra_analysis/src/hir/db.rs @@ -25,37 +25,37 @@ pub(crate) trait HirDatabase: SyntaxDatabase + IdDatabase { use fn crate::hir::function::imp::fn_scopes; } - fn _file_items(file_id: FileId) -> Arc { + fn file_items(file_id: FileId) -> Arc { type FileItemsQuery; storage dependencies; use fn crate::hir::module::nameres::file_items; } - fn _file_item(file_id: FileId, file_item_id: FileItemId) -> SyntaxNode { + fn file_item(file_id: FileId, file_item_id: FileItemId) -> SyntaxNode { type FileItemQuery; storage dependencies; use fn crate::hir::module::nameres::file_item; } - fn _input_module_items(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable> { + fn input_module_items(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable> { type InputModuleItemsQuery; use fn crate::hir::module::nameres::input_module_items; } - fn _item_map(source_root_id: SourceRootId) -> Cancelable> { + fn item_map(source_root_id: SourceRootId) -> Cancelable> { type ItemMapQuery; use fn crate::hir::module::nameres::item_map; } - fn _module_tree(source_root_id: SourceRootId) -> Cancelable> { + fn module_tree(source_root_id: SourceRootId) -> Cancelable> { type ModuleTreeQuery; use fn crate::hir::module::imp::module_tree; } - fn _fn_syntax(fn_id: FnId) -> FnDefNode { + fn fn_syntax(fn_id: FnId) -> FnDefNode { type FnSyntaxQuery; // Don't retain syntax trees in memory storage dependencies; use fn crate::hir::function::imp::fn_syntax; } - fn _submodules(source: ModuleSource) -> Cancelable>> { + fn submodules(source: ModuleSource) -> Cancelable>> { type SubmodulesQuery; use fn crate::hir::module::imp::submodules; } diff --git a/crates/ra_analysis/src/hir/function/imp.rs b/crates/ra_analysis/src/hir/function/imp.rs index 0d487d024..5f5f68ac5 100644 --- a/crates/ra_analysis/src/hir/function/imp.rs +++ b/crates/ra_analysis/src/hir/function/imp.rs @@ -15,7 +15,7 @@ pub(crate) fn fn_syntax(db: &impl HirDatabase, fn_id: FnId) -> FnDefNode { } pub(crate) fn fn_scopes(db: &impl HirDatabase, fn_id: FnId) -> Arc { - let syntax = db._fn_syntax(fn_id); + let syntax = db.fn_syntax(fn_id); let res = FnScopes::new(syntax.borrowed()); Arc::new(res) } diff --git a/crates/ra_analysis/src/hir/module/imp.rs b/crates/ra_analysis/src/hir/module/imp.rs index 062457ae0..f9853584e 100644 --- a/crates/ra_analysis/src/hir/module/imp.rs +++ b/crates/ra_analysis/src/hir/module/imp.rs @@ -135,7 +135,7 @@ fn build_subtree( parent, children: Vec::new(), }); - for sub in db._submodules(source)?.iter() { + for sub in db.submodules(source)?.iter() { let link = tree.push_link(LinkData { name: sub.name().clone(), owner: id, diff --git a/crates/ra_analysis/src/hir/module/mod.rs b/crates/ra_analysis/src/hir/module/mod.rs index 5bff11c90..55b6639be 100644 --- a/crates/ra_analysis/src/hir/module/mod.rs +++ b/crates/ra_analysis/src/hir/module/mod.rs @@ -64,7 +64,7 @@ impl ModuleDescriptor { module_source: ModuleSource, ) -> Cancelable> { let source_root_id = db.file_source_root(file_id); - let module_tree = db._module_tree(source_root_id)?; + let module_tree = db.module_tree(source_root_id)?; let res = match module_tree.any_module_for_source(module_source) { None => None, @@ -82,7 +82,7 @@ impl ModuleDescriptor { source_root_id: SourceRootId, module_id: ModuleId, ) -> Cancelable { - let module_tree = db._module_tree(source_root_id)?; + let module_tree = db.module_tree(source_root_id)?; let res = ModuleDescriptor { tree: module_tree, source_root_id, @@ -148,7 +148,7 @@ impl ModuleDescriptor { /// Returns a `ModuleScope`: a set of items, visible in this module. pub(crate) fn scope(&self, db: &impl HirDatabase) -> Cancelable { - let item_map = db._item_map(self.source_root_id)?; + let item_map = db.item_map(self.source_root_id)?; let res = item_map.per_module[&self.module_id].clone(); Ok(res) } diff --git a/crates/ra_analysis/src/hir/module/nameres.rs b/crates/ra_analysis/src/hir/module/nameres.rs index bb5a888c8..eaf9f9373 100644 --- a/crates/ra_analysis/src/hir/module/nameres.rs +++ b/crates/ra_analysis/src/hir/module/nameres.rs @@ -91,7 +91,7 @@ pub(crate) fn file_item( file_id: FileId, file_item_id: FileItemId, ) -> SyntaxNode { - db._file_items(file_id)[file_item_id].clone() + db.file_items(file_id)[file_item_id].clone() } /// Item map is the result of the name resolution. Item map contains, for each @@ -155,7 +155,7 @@ pub(crate) struct NamedImport { impl NamedImport { pub(crate) fn range(&self, db: &impl HirDatabase, file_id: FileId) -> TextRange { - let syntax = db._file_item(file_id, self.file_item_id); + let syntax = db.file_item(file_id, self.file_item_id); let offset = syntax.borrowed().range().start(); self.relative_range + offset } @@ -172,9 +172,9 @@ pub(crate) fn input_module_items( source_root: SourceRootId, module_id: ModuleId, ) -> Cancelable> { - let module_tree = db._module_tree(source_root)?; + let module_tree = db.module_tree(source_root)?; let source = module_id.source(&module_tree); - let file_items = db._file_items(source.file_id()); + let file_items = db.file_items(source.file_id()); let res = match source.resolve(db) { ModuleSourceNode::SourceFile(it) => { let items = it.borrowed().items(); @@ -197,11 +197,11 @@ pub(crate) fn item_map( source_root: SourceRootId, ) -> Cancelable> { let start = Instant::now(); - let module_tree = db._module_tree(source_root)?; + let module_tree = db.module_tree(source_root)?; let input = module_tree .modules() .map(|id| { - let items = db._input_module_items(source_root, id)?; + let items = db.input_module_items(source_root, id)?; Ok((id, items)) }) .collect::>>()?; @@ -460,7 +460,7 @@ mod tests { .unwrap() .unwrap(); let module_id = descr.module_id; - (db._item_map(source_root).unwrap(), module_id) + (db.item_map(source_root).unwrap(), module_id) } #[test] @@ -513,9 +513,9 @@ mod tests { { let db = host.analysis().imp.db; let events = db.log_executed(|| { - db._item_map(source_root).unwrap(); + db.item_map(source_root).unwrap(); }); - assert!(format!("{:?}", events).contains("_item_map")) + assert!(format!("{:?}", events).contains("item_map")) } let mut change = AnalysisChange::new(); @@ -537,7 +537,7 @@ mod tests { { let db = host.analysis().imp.db; let events = db.log_executed(|| { - db._item_map(source_root).unwrap(); + db.item_map(source_root).unwrap(); }); assert!( !format!("{:?}", events).contains("_item_map"), -- cgit v1.2.3