mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
internal: Load VFS config changes in parallel
This commit is contained in:
parent
758ad25229
commit
8286847bee
7 changed files with 128 additions and 80 deletions
|
@ -43,6 +43,13 @@ pub struct Config {
|
|||
pub watch: Vec<usize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum LoadingProgress {
|
||||
Started,
|
||||
Progress(usize),
|
||||
Finished,
|
||||
}
|
||||
|
||||
/// Message about an action taken by a [`Handle`].
|
||||
pub enum Message {
|
||||
/// Indicate a gradual progress.
|
||||
|
@ -52,7 +59,7 @@ pub enum Message {
|
|||
/// The total files to be loaded.
|
||||
n_total: usize,
|
||||
/// The files that have been loaded successfully.
|
||||
n_done: Option<usize>,
|
||||
n_done: LoadingProgress,
|
||||
/// The dir being loaded, `None` if its for a file.
|
||||
dir: Option<AbsPathBuf>,
|
||||
/// The [`Config`] version.
|
||||
|
@ -65,7 +72,7 @@ pub enum Message {
|
|||
}
|
||||
|
||||
/// Type that will receive [`Messages`](Message) from a [`Handle`].
|
||||
pub type Sender = Box<dyn Fn(Message) + Send>;
|
||||
pub type Sender = Box<dyn Fn(Message) + Send + Sync>;
|
||||
|
||||
/// Interface for reading and watching files.
|
||||
pub trait Handle: fmt::Debug {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue