diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-29 16:25:12 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-29 16:25:12 +0100 |
commit | 32ee06032785ea1792144f7263cbce93a4de467b (patch) | |
tree | fac101a18e111a2a05bce14fbb68981c5bef3bfd /crates/ra_hir_ty/src/test_db.rs | |
parent | 82ce5792ab70ab8d20a1afde72c5400c27b9c190 (diff) | |
parent | bbc4dc995612916a4c0a99396b5259a5fb1dda80 (diff) |
Merge #5127
5127: Update the rest of the tests r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/test_db.rs')
-rw-r--r-- | crates/ra_hir_ty/src/test_db.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index 9c2c6959d..0481a7b12 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs | |||
@@ -154,6 +154,19 @@ impl TestDB { | |||
154 | }); | 154 | }); |
155 | (buf, count) | 155 | (buf, count) |
156 | } | 156 | } |
157 | |||
158 | pub fn all_files(&self) -> Vec<FileId> { | ||
159 | let mut res = Vec::new(); | ||
160 | let crate_graph = self.crate_graph(); | ||
161 | for krate in crate_graph.iter() { | ||
162 | let crate_def_map = self.crate_def_map(krate); | ||
163 | for (module_id, _) in crate_def_map.modules.iter() { | ||
164 | let file_id = crate_def_map[module_id].origin.file_id(); | ||
165 | res.extend(file_id) | ||
166 | } | ||
167 | } | ||
168 | res | ||
169 | } | ||
157 | } | 170 | } |
158 | 171 | ||
159 | impl TestDB { | 172 | impl TestDB { |