aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/hir/module/nameres.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-27 20:05:33 +0000
committerAleksey Kladov <[email protected]>2018-11-27 20:05:33 +0000
commit90bc832b22aefb2a382b3465793df7e528351aa1 (patch)
treec4955035b53573101aef9a9cbb776ce6c6a90c5b /crates/ra_analysis/src/hir/module/nameres.rs
parentf14902f67bbc5f68cb700b6b929b269d3d51a4a9 (diff)
remove underscores
Diffstat (limited to 'crates/ra_analysis/src/hir/module/nameres.rs')
-rw-r--r--crates/ra_analysis/src/hir/module/nameres.rs20
1 files changed, 10 insertions, 10 deletions
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(
91 file_id: FileId, 91 file_id: FileId,
92 file_item_id: FileItemId, 92 file_item_id: FileItemId,
93) -> SyntaxNode { 93) -> SyntaxNode {
94 db._file_items(file_id)[file_item_id].clone() 94 db.file_items(file_id)[file_item_id].clone()
95} 95}
96 96
97/// Item map is the result of the name resolution. Item map contains, for each 97/// Item map is the result of the name resolution. Item map contains, for each
@@ -155,7 +155,7 @@ pub(crate) struct NamedImport {
155 155
156impl NamedImport { 156impl NamedImport {
157 pub(crate) fn range(&self, db: &impl HirDatabase, file_id: FileId) -> TextRange { 157 pub(crate) fn range(&self, db: &impl HirDatabase, file_id: FileId) -> TextRange {
158 let syntax = db._file_item(file_id, self.file_item_id); 158 let syntax = db.file_item(file_id, self.file_item_id);
159 let offset = syntax.borrowed().range().start(); 159 let offset = syntax.borrowed().range().start();
160 self.relative_range + offset 160 self.relative_range + offset
161 } 161 }
@@ -172,9 +172,9 @@ pub(crate) fn input_module_items(
172 source_root: SourceRootId, 172 source_root: SourceRootId,
173 module_id: ModuleId, 173 module_id: ModuleId,
174) -> Cancelable<Arc<InputModuleItems>> { 174) -> Cancelable<Arc<InputModuleItems>> {
175 let module_tree = db._module_tree(source_root)?; 175 let module_tree = db.module_tree(source_root)?;
176 let source = module_id.source(&module_tree); 176 let source = module_id.source(&module_tree);
177 let file_items = db._file_items(source.file_id()); 177 let file_items = db.file_items(source.file_id());
178 let res = match source.resolve(db) { 178 let res = match source.resolve(db) {
179 ModuleSourceNode::SourceFile(it) => { 179 ModuleSourceNode::SourceFile(it) => {
180 let items = it.borrowed().items(); 180 let items = it.borrowed().items();
@@ -197,11 +197,11 @@ pub(crate) fn item_map(
197 source_root: SourceRootId, 197 source_root: SourceRootId,
198) -> Cancelable<Arc<ItemMap>> { 198) -> Cancelable<Arc<ItemMap>> {
199 let start = Instant::now(); 199 let start = Instant::now();
200 let module_tree = db._module_tree(source_root)?; 200 let module_tree = db.module_tree(source_root)?;
201 let input = module_tree 201 let input = module_tree
202 .modules() 202 .modules()
203 .map(|id| { 203 .map(|id| {
204 let items = db._input_module_items(source_root, id)?; 204 let items = db.input_module_items(source_root, id)?;
205 Ok((id, items)) 205 Ok((id, items))
206 }) 206 })
207 .collect::<Cancelable<FxHashMap<_, _>>>()?; 207 .collect::<Cancelable<FxHashMap<_, _>>>()?;
@@ -460,7 +460,7 @@ mod tests {
460 .unwrap() 460 .unwrap()
461 .unwrap(); 461 .unwrap();
462 let module_id = descr.module_id; 462 let module_id = descr.module_id;
463 (db._item_map(source_root).unwrap(), module_id) 463 (db.item_map(source_root).unwrap(), module_id)
464 } 464 }
465 465
466 #[test] 466 #[test]
@@ -513,9 +513,9 @@ mod tests {
513 { 513 {
514 let db = host.analysis().imp.db; 514 let db = host.analysis().imp.db;
515 let events = db.log_executed(|| { 515 let events = db.log_executed(|| {
516 db._item_map(source_root).unwrap(); 516 db.item_map(source_root).unwrap();
517 }); 517 });
518 assert!(format!("{:?}", events).contains("_item_map")) 518 assert!(format!("{:?}", events).contains("item_map"))
519 } 519 }
520 520
521 let mut change = AnalysisChange::new(); 521 let mut change = AnalysisChange::new();
@@ -537,7 +537,7 @@ mod tests {
537 { 537 {
538 let db = host.analysis().imp.db; 538 let db = host.analysis().imp.db;
539 let events = db.log_executed(|| { 539 let events = db.log_executed(|| {
540 db._item_map(source_root).unwrap(); 540 db.item_map(source_root).unwrap();
541 }); 541 });
542 assert!( 542 assert!(
543 !format!("{:?}", events).contains("_item_map"), 543 !format!("{:?}", events).contains("_item_map"),