mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Add a command to clear flycheck diagnostics
This commit is contained in:
parent
d8ddde27f9
commit
cf8d89e46b
7 changed files with 64 additions and 2 deletions
|
@ -144,6 +144,13 @@ impl Notification for RunFlycheck {
|
|||
const METHOD: &'static str = "rust-analyzer/runFlycheck";
|
||||
}
|
||||
|
||||
pub enum ClearFlycheck {}
|
||||
|
||||
impl Notification for ClearFlycheck {
|
||||
type Params = ();
|
||||
const METHOD: &'static str = "rust-analyzer/clearFlycheck";
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct RunFlycheckParams {
|
||||
|
|
|
@ -861,6 +861,10 @@ impl GlobalState {
|
|||
}
|
||||
Ok(())
|
||||
})?
|
||||
.on::<lsp_ext::ClearFlycheck>(|this, ()| {
|
||||
this.diagnostics.clear_check_all();
|
||||
Ok(())
|
||||
})?
|
||||
.on::<lsp_ext::RunFlycheck>(|this, params| {
|
||||
if let Some(text_document) = params.text_document {
|
||||
if let Ok(vfs_path) = from_proto::vfs_path(&text_document.uri) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue