forked from ethereum/fe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.rs
32 lines (28 loc) · 747 Bytes
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pub(crate) mod db;
pub(crate) mod workspace;
use db::LanguageServerDatabase;
use workspace::Workspace;
use tower_lsp::Client;
pub struct Backend {
pub(super) client: Client,
pub(super) db: LanguageServerDatabase,
pub(super) workspace: Workspace,
pub(super) workers: tokio::runtime::Runtime,
}
impl Backend {
pub fn new(client: Client) -> Self {
let db = LanguageServerDatabase::default();
let workspace = Workspace::default();
let workers = tokio::runtime::Builder::new_multi_thread()
.worker_threads(4)
.enable_all()
.build()
.unwrap();
Self {
client,
db,
workspace,
workers,
}
}
}