mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
feat(lsp): quick fix actions to ignore lint errors (#10627)
Closes #10122
This commit is contained in:
parent
bbc2745350
commit
952caa79b3
6 changed files with 266 additions and 1 deletions
|
@ -976,6 +976,7 @@ impl Inner {
|
|||
}
|
||||
_ => false,
|
||||
},
|
||||
"deno-lint" => matches!(&d.code, Some(_)),
|
||||
"deno" => match &d.code {
|
||||
Some(NumberOrString::String(code)) => {
|
||||
code == "no-cache" || code == "no-cache-data"
|
||||
|
@ -1049,6 +1050,16 @@ impl Inner {
|
|||
LspError::internal_error()
|
||||
})?
|
||||
}
|
||||
Some("deno-lint") => code_actions
|
||||
.add_deno_lint_ignore_action(
|
||||
&specifier,
|
||||
self.documents.docs.get(&specifier),
|
||||
diagnostic,
|
||||
)
|
||||
.map_err(|err| {
|
||||
error!("Unable to fix lint error: {}", err);
|
||||
LspError::internal_error()
|
||||
})?,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue