mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Add new crate
This commit is contained in:
parent
166c720425
commit
15224dfcd5
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -909,6 +909,26 @@ dependencies = [
|
|||||||
"test_utils 0.1.0",
|
"test_utils 0.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ra_batch"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"fst 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"insta 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"ra_db 0.1.0",
|
||||||
|
"ra_hir 0.1.0",
|
||||||
|
"ra_syntax 0.1.0",
|
||||||
|
"rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"test_utils 0.1.0",
|
||||||
|
"unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ra_cli"
|
name = "ra_cli"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
24
crates/ra_batch/Cargo.toml
Normal file
24
crates/ra_batch/Cargo.toml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[package]
|
||||||
|
edition = "2018"
|
||||||
|
name = "ra_batch"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
itertools = "0.8.0"
|
||||||
|
join_to_string = "0.1.3"
|
||||||
|
log = "0.4.5"
|
||||||
|
relative-path = "0.4.0"
|
||||||
|
rayon = "1.0.2"
|
||||||
|
fst = "0.3.1"
|
||||||
|
rustc-hash = "1.0"
|
||||||
|
parking_lot = "0.7.0"
|
||||||
|
unicase = "2.2.0"
|
||||||
|
|
||||||
|
ra_syntax = { path = "../ra_syntax" }
|
||||||
|
ra_db = { path = "../ra_db" }
|
||||||
|
ra_hir = { path = "../ra_hir" }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
test_utils = { path = "../test_utils" }
|
||||||
|
insta = "0.6.1"
|
30
crates/ra_batch/src/lib.rs
Normal file
30
crates/ra_batch/src/lib.rs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use ra_db::{
|
||||||
|
FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa,
|
||||||
|
};
|
||||||
|
use ra_hir::{db, HirInterner};
|
||||||
|
|
||||||
|
#[salsa::database(
|
||||||
|
ra_db::SourceDatabaseStorage,
|
||||||
|
db::HirDatabaseStorage,
|
||||||
|
db::PersistentHirDatabaseStorage
|
||||||
|
)]
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub(crate) struct BatchDatabase {
|
||||||
|
runtime: salsa::Runtime<BatchDatabase>,
|
||||||
|
interner: Arc<HirInterner>,
|
||||||
|
file_counter: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl salsa::Database for BatchDatabase {
|
||||||
|
fn salsa_runtime(&self) -> &salsa::Runtime<BatchDatabase> {
|
||||||
|
&self.runtime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AsRef<HirInterner> for BatchDatabase {
|
||||||
|
fn as_ref(&self) -> &HirInterner {
|
||||||
|
&self.interner
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user