aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_batch
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_batch')
-rw-r--r--crates/ra_batch/Cargo.toml24
-rw-r--r--crates/ra_batch/src/lib.rs30
2 files changed, 54 insertions, 0 deletions
diff --git a/crates/ra_batch/Cargo.toml b/crates/ra_batch/Cargo.toml
new file mode 100644
index 000000000..3e83f8388
--- /dev/null
+++ b/crates/ra_batch/Cargo.toml
@@ -0,0 +1,24 @@
1[package]
2edition = "2018"
3name = "ra_batch"
4version = "0.1.0"
5authors = ["Aleksey Kladov <[email protected]>"]
6
7[dependencies]
8itertools = "0.8.0"
9join_to_string = "0.1.3"
10log = "0.4.5"
11relative-path = "0.4.0"
12rayon = "1.0.2"
13fst = "0.3.1"
14rustc-hash = "1.0"
15parking_lot = "0.7.0"
16unicase = "2.2.0"
17
18ra_syntax = { path = "../ra_syntax" }
19ra_db = { path = "../ra_db" }
20ra_hir = { path = "../ra_hir" }
21
22[dev-dependencies]
23test_utils = { path = "../test_utils" }
24insta = "0.6.1"
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs
new file mode 100644
index 000000000..25f1f7357
--- /dev/null
+++ b/crates/ra_batch/src/lib.rs
@@ -0,0 +1,30 @@
1use std::sync::Arc;
2
3use ra_db::{
4 FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa,
5};
6use ra_hir::{db, HirInterner};
7
8#[salsa::database(
9 ra_db::SourceDatabaseStorage,
10 db::HirDatabaseStorage,
11 db::PersistentHirDatabaseStorage
12)]
13#[derive(Debug)]
14pub(crate) struct BatchDatabase {
15 runtime: salsa::Runtime<BatchDatabase>,
16 interner: Arc<HirInterner>,
17 file_counter: u32,
18}
19
20impl salsa::Database for BatchDatabase {
21 fn salsa_runtime(&self) -> &salsa::Runtime<BatchDatabase> {
22 &self.runtime
23 }
24}
25
26impl AsRef<HirInterner> for BatchDatabase {
27 fn as_ref(&self) -> &HirInterner {
28 &self.interner
29 }
30}