Allow canceling in-progress language server work (e.g. cargo check
) (#13173)
Release Notes: - Added a more detailed message in place of the generic `checking...` messages when Rust-analyzer is running. - Added a rate limit for language server status messages, to reduce noisiness of those updates. - Added a `cancel language server work` action which will cancel long-running language server tasks. --------- Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
parent
f489c8b79f
commit
7003b0f211
15 changed files with 308 additions and 164 deletions
|
@ -13,7 +13,7 @@ use std::{
|
|||
Arc,
|
||||
},
|
||||
task::{Context, Poll},
|
||||
time::Duration,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use util::TryFutureExt;
|
||||
use waker_fn::waker_fn;
|
||||
|
@ -316,6 +316,14 @@ impl BackgroundExecutor {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get the current time.
|
||||
///
|
||||
/// Calling this instead of `std::time::Instant::now` allows the use
|
||||
/// of fake timers in tests.
|
||||
pub fn now(&self) -> Instant {
|
||||
self.dispatcher.now()
|
||||
}
|
||||
|
||||
/// Returns a task that will complete after the given duration.
|
||||
/// Depending on other concurrent tasks the elapsed duration may be longer
|
||||
/// than requested.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue