summaryrefslogtreecommitdiff
path: root/cli/lsp/analysis.rs
diff options
context:
space:
mode:
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.