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:
Max Brunsfeld 2024-06-17 17:58:47 -07:00 committed by GitHub
parent f489c8b79f
commit 7003b0f211
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 308 additions and 164 deletions

View file

@ -38,7 +38,7 @@ use seahash::SeaHasher;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
use std::hash::{Hash, Hasher};
use std::time::Duration;
use std::time::{Duration, Instant};
use std::{
fmt::{self, Debug},
ops::Range,
@ -275,6 +275,9 @@ pub trait PlatformDispatcher: Send + Sync {
fn dispatch_after(&self, duration: Duration, runnable: Runnable);
fn park(&self, timeout: Option<Duration>) -> bool;
fn unparker(&self) -> Unparker;
fn now(&self) -> Instant {
Instant::now()
}
#[cfg(any(test, feature = "test-support"))]
fn as_test(&self) -> Option<&TestDispatcher> {