diff options
author | Satya Rohith <me@satyarohith.com> | 2021-06-21 12:13:35 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-21 16:43:35 +1000 |
commit | 952caa79b32e6c249977281ed494d4b1f98ed451 (patch) | |
tree | 3f072fc64b571eca1b203fb07df3689ad4fc3a95 /cli/lsp/language_server.rs | |
parent | bbc2745350687f209c6af75958cc12bb43e64042 (diff) |
feat(lsp): quick fix actions to ignore lint errors (#10627)
Closes #10122
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r-- | cli/lsp/language_server.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 5a016d5c3..491e402ad 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -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() + })?, _ => (), } } |