From bb4b00df929a84d0302659700b97160f0fdbab78 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sun, 24 Sep 2023 23:33:52 +0100 Subject: feat(lsp): cache all dependencies quick fix (#20665) --- cli/lsp/analysis.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli/lsp/analysis.rs') 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, + ) { + 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. -- cgit v1.2.3