summaryrefslogtreecommitdiff
path: root/cli/lsp/analysis.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-09-24 23:33:52 +0100
committerGitHub <noreply@github.com>2023-09-24 23:33:52 +0100
commitbb4b00df929a84d0302659700b97160f0fdbab78 (patch)
treeb389f460b21830da2837af059f218e00c3c7b138 /cli/lsp/analysis.rs
parentb2abae477115dc6ca97a767c6800c7c3f1aa0ebb (diff)
feat(lsp): cache all dependencies quick fix (#20665)
Diffstat (limited to 'cli/lsp/analysis.rs')
-rw-r--r--cli/lsp/analysis.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs
index c1def6012..0d987163b 100644
--- a/cli/lsp/analysis.rs
+++ b/cli/lsp/analysis.rs
@@ -917,6 +917,24 @@ impl CodeActionCollection {
}
}
}
+
+ pub fn add_cache_all_action(
+ &mut self,
+ specifier: &ModuleSpecifier,
+ diagnostics: Vec<lsp::Diagnostic>,
+ ) {
+ self.actions.push(CodeActionKind::Deno(lsp::CodeAction {
+ title: "Cache all dependencies of this module.".to_string(),
+ kind: Some(lsp::CodeActionKind::QUICKFIX),
+ diagnostics: Some(diagnostics),
+ command: Some(lsp::Command {
+ title: "".to_string(),
+ command: "deno.cache".to_string(),
+ arguments: Some(vec![json!([]), json!(&specifier)]),
+ }),
+ ..Default::default()
+ }));
+ }
}
/// Prepend the whitespace characters found at the start of line_content to content.