diff options
author | Aleksey Kladov <[email protected]> | 2020-02-06 15:54:22 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-06 15:56:42 +0000 |
commit | f8965ffafd5cf467b3f0482ca962ba2bfd090161 (patch) | |
tree | 4a76a51a4ae011b23f256e25c747fa0c0a8f3ab3 /crates/ra_assists/src | |
parent | 2c922ef54958a82ce745e6db6834062f97f21bed (diff) |
Remove assists TestDB
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/test_db.rs | 45 |
2 files changed, 0 insertions, 47 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index a2109b751..be6e06842 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -9,8 +9,6 @@ mod assist_ctx; | |||
9 | mod marks; | 9 | mod marks; |
10 | #[cfg(test)] | 10 | #[cfg(test)] |
11 | mod doc_tests; | 11 | mod doc_tests; |
12 | #[cfg(test)] | ||
13 | mod test_db; | ||
14 | pub mod ast_transform; | 12 | pub mod ast_transform; |
15 | 13 | ||
16 | use either::Either; | 14 | use either::Either; |
diff --git a/crates/ra_assists/src/test_db.rs b/crates/ra_assists/src/test_db.rs deleted file mode 100644 index d5249f308..000000000 --- a/crates/ra_assists/src/test_db.rs +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | //! Database used for testing `ra_assists`. | ||
2 | |||
3 | use std::sync::Arc; | ||
4 | |||
5 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, RelativePath}; | ||
6 | |||
7 | #[salsa::database( | ||
8 | ra_db::SourceDatabaseExtStorage, | ||
9 | ra_db::SourceDatabaseStorage, | ||
10 | hir::db::InternDatabaseStorage, | ||
11 | hir::db::AstDatabaseStorage, | ||
12 | hir::db::DefDatabaseStorage, | ||
13 | hir::db::HirDatabaseStorage | ||
14 | )] | ||
15 | #[derive(Debug, Default)] | ||
16 | pub struct TestDB { | ||
17 | runtime: salsa::Runtime<TestDB>, | ||
18 | } | ||
19 | |||
20 | impl salsa::Database for TestDB { | ||
21 | fn salsa_runtime(&self) -> &salsa::Runtime<Self> { | ||
22 | &self.runtime | ||
23 | } | ||
24 | fn salsa_runtime_mut(&mut self) -> &mut salsa::Runtime<Self> { | ||
25 | &mut self.runtime | ||
26 | } | ||
27 | } | ||
28 | |||
29 | impl std::panic::RefUnwindSafe for TestDB {} | ||
30 | |||
31 | impl FileLoader for TestDB { | ||
32 | fn file_text(&self, file_id: FileId) -> Arc<String> { | ||
33 | FileLoaderDelegate(self).file_text(file_id) | ||
34 | } | ||
35 | fn resolve_relative_path( | ||
36 | &self, | ||
37 | anchor: FileId, | ||
38 | relative_path: &RelativePath, | ||
39 | ) -> Option<FileId> { | ||
40 | FileLoaderDelegate(self).resolve_relative_path(anchor, relative_path) | ||
41 | } | ||
42 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { | ||
43 | FileLoaderDelegate(self).relevant_crates(file_id) | ||
44 | } | ||
45 | } | ||