diff options
author | Aleksey Kladov <[email protected]> | 2018-11-27 20:05:33 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-27 20:05:33 +0000 |
commit | 90bc832b22aefb2a382b3465793df7e528351aa1 (patch) | |
tree | c4955035b53573101aef9a9cbb776ce6c6a90c5b /crates/ra_analysis/src/hir/module | |
parent | f14902f67bbc5f68cb700b6b929b269d3d51a4a9 (diff) |
remove underscores
Diffstat (limited to 'crates/ra_analysis/src/hir/module')
-rw-r--r-- | crates/ra_analysis/src/hir/module/imp.rs | 2 | ||||
-rw-r--r-- | crates/ra_analysis/src/hir/module/mod.rs | 6 | ||||
-rw-r--r-- | crates/ra_analysis/src/hir/module/nameres.rs | 20 |
3 files changed, 14 insertions, 14 deletions
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( | |||
135 | parent, | 135 | parent, |
136 | children: Vec::new(), | 136 | children: Vec::new(), |
137 | }); | 137 | }); |
138 | for sub in db._submodules(source)?.iter() { | 138 | for sub in db.submodules(source)?.iter() { |
139 | let link = tree.push_link(LinkData { | 139 | let link = tree.push_link(LinkData { |
140 | name: sub.name().clone(), | 140 | name: sub.name().clone(), |
141 | owner: id, | 141 | 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 { | |||
64 | module_source: ModuleSource, | 64 | module_source: ModuleSource, |
65 | ) -> Cancelable<Option<ModuleDescriptor>> { | 65 | ) -> Cancelable<Option<ModuleDescriptor>> { |
66 | let source_root_id = db.file_source_root(file_id); | 66 | let source_root_id = db.file_source_root(file_id); |
67 | let module_tree = db._module_tree(source_root_id)?; | 67 | let module_tree = db.module_tree(source_root_id)?; |
68 | 68 | ||
69 | let res = match module_tree.any_module_for_source(module_source) { | 69 | let res = match module_tree.any_module_for_source(module_source) { |
70 | None => None, | 70 | None => None, |
@@ -82,7 +82,7 @@ impl ModuleDescriptor { | |||
82 | source_root_id: SourceRootId, | 82 | source_root_id: SourceRootId, |
83 | module_id: ModuleId, | 83 | module_id: ModuleId, |
84 | ) -> Cancelable<ModuleDescriptor> { | 84 | ) -> Cancelable<ModuleDescriptor> { |
85 | let module_tree = db._module_tree(source_root_id)?; | 85 | let module_tree = db.module_tree(source_root_id)?; |
86 | let res = ModuleDescriptor { | 86 | let res = ModuleDescriptor { |
87 | tree: module_tree, | 87 | tree: module_tree, |
88 | source_root_id, | 88 | source_root_id, |
@@ -148,7 +148,7 @@ impl ModuleDescriptor { | |||
148 | 148 | ||
149 | /// Returns a `ModuleScope`: a set of items, visible in this module. | 149 | /// Returns a `ModuleScope`: a set of items, visible in this module. |
150 | pub(crate) fn scope(&self, db: &impl HirDatabase) -> Cancelable<ModuleScope> { | 150 | pub(crate) fn scope(&self, db: &impl HirDatabase) -> Cancelable<ModuleScope> { |
151 | let item_map = db._item_map(self.source_root_id)?; | 151 | let item_map = db.item_map(self.source_root_id)?; |
152 | let res = item_map.per_module[&self.module_id].clone(); | 152 | let res = item_map.per_module[&self.module_id].clone(); |
153 | Ok(res) | 153 | Ok(res) |
154 | } | 154 | } |
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 | ||
156 | impl NamedImport { | 156 | impl 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"), |