aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-06 15:54:22 +0000
committerAleksey Kladov <[email protected]>2020-02-06 15:56:42 +0000
commitf8965ffafd5cf467b3f0482ca962ba2bfd090161 (patch)
tree4a76a51a4ae011b23f256e25c747fa0c0a8f3ab3
parent2c922ef54958a82ce745e6db6834062f97f21bed (diff)
Remove assists TestDB
-rw-r--r--crates/ra_assists/src/lib.rs2
-rw-r--r--crates/ra_assists/src/test_db.rs45
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;
9mod marks; 9mod marks;
10#[cfg(test)] 10#[cfg(test)]
11mod doc_tests; 11mod doc_tests;
12#[cfg(test)]
13mod test_db;
14pub mod ast_transform; 12pub mod ast_transform;
15 13
16use either::Either; 14use 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
3use std::sync::Arc;
4
5use 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)]
16pub struct TestDB {
17 runtime: salsa::Runtime<TestDB>,
18}
19
20impl 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
29impl std::panic::RefUnwindSafe for TestDB {}
30
31impl 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}