mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Move TaskPool into GlobalState
This commit is contained in:
parent
9be0094b5c
commit
dd20c2ec5b
4 changed files with 98 additions and 84 deletions
|
@ -20,8 +20,9 @@ use crate::{
|
|||
diagnostics::{CheckFixes, DiagnosticCollection},
|
||||
from_proto,
|
||||
line_endings::LineEndings,
|
||||
main_loop::ReqQueue,
|
||||
main_loop::{ReqQueue, Task},
|
||||
request_metrics::{LatestRequests, RequestMetrics},
|
||||
thread_pool::TaskPool,
|
||||
to_proto::url_from_abs_path,
|
||||
Result,
|
||||
};
|
||||
|
@ -66,6 +67,7 @@ impl Default for Status {
|
|||
/// incremental salsa database.
|
||||
pub(crate) struct GlobalState {
|
||||
pub(crate) config: Config,
|
||||
pub(crate) task_pool: (TaskPool<Task>, Receiver<Task>),
|
||||
pub(crate) analysis_host: AnalysisHost,
|
||||
pub(crate) loader: Box<dyn vfs::loader::Handle>,
|
||||
pub(crate) task_receiver: Receiver<vfs::loader::Message>,
|
||||
|
@ -153,8 +155,15 @@ impl GlobalState {
|
|||
|
||||
let mut analysis_host = AnalysisHost::new(lru_capacity);
|
||||
analysis_host.apply_change(change);
|
||||
|
||||
let task_pool = {
|
||||
let (sender, receiver) = unbounded();
|
||||
(TaskPool::new(sender), receiver)
|
||||
};
|
||||
|
||||
let mut res = GlobalState {
|
||||
config,
|
||||
task_pool,
|
||||
analysis_host,
|
||||
loader,
|
||||
task_receiver,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue