aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-05 21:54:17 +0000
committerFlorian Diebold <[email protected]>2019-02-10 09:56:58 +0000
commit15224dfcd5fc5338844aec5993abf98f7f283e1e (patch)
treec40bf7922161320ebcde2fe633e1bc6545e52e75
parent166c72042564bc94586b071d627164a06400576b (diff)
Add new crate
-rw-r--r--Cargo.lock20
-rw-r--r--crates/ra_batch/Cargo.toml24
-rw-r--r--crates/ra_batch/src/lib.rs30
3 files changed, 74 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 0009cdaab..53c2498f1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -910,6 +910,26 @@ dependencies = [
910] 910]
911 911
912[[package]] 912[[package]]
913name = "ra_batch"
914version = "0.1.0"
915dependencies = [
916 "fst 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
917 "insta 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
918 "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
919 "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
920 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
921 "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
922 "ra_db 0.1.0",
923 "ra_hir 0.1.0",
924 "ra_syntax 0.1.0",
925 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
926 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
927 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
928 "test_utils 0.1.0",
929 "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
930]
931
932[[package]]
913name = "ra_cli" 933name = "ra_cli"
914version = "0.1.0" 934version = "0.1.0"
915dependencies = [ 935dependencies = [
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}