From d6c05b09dd7cbaba0fcae65929a2c2dd55e9d994 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 12 Feb 2021 15:17:48 +1100 Subject: feat(lsp): add deno cache code actions (#9471) --- cli/tests/lsp/code_action_request_cache.json | 46 ++++++++++++++++++++++++++ cli/tests/lsp/code_action_response_cache.json | 36 ++++++++++++++++++++ cli/tests/lsp/did_open_notification_cache.json | 12 +++++++ 3 files changed, 94 insertions(+) create mode 100644 cli/tests/lsp/code_action_request_cache.json create mode 100644 cli/tests/lsp/code_action_response_cache.json create mode 100644 cli/tests/lsp/did_open_notification_cache.json (limited to 'cli/tests/lsp') diff --git a/cli/tests/lsp/code_action_request_cache.json b/cli/tests/lsp/code_action_request_cache.json new file mode 100644 index 000000000..8e296be32 --- /dev/null +++ b/cli/tests/lsp/code_action_request_cache.json @@ -0,0 +1,46 @@ +{ + "jsonrpc": "2.0", + "id": 2, + "method": "textDocument/codeAction", + "params": { + "textDocument": { + "uri": "file:///a/file.ts" + }, + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 49 + } + }, + "context": { + "diagnostics": [ + { + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 49 + } + }, + "severity": 1, + "code": "no-cache", + "source": "deno", + "message": "Unable to load the remote module: \"https://deno.land/x/a/mod.ts\".", + "data": { + "specifier": "https://deno.land/x/a/mod.ts" + } + } + ], + "only": [ + "quickfix" + ] + } + } +} diff --git a/cli/tests/lsp/code_action_response_cache.json b/cli/tests/lsp/code_action_response_cache.json new file mode 100644 index 000000000..c56b35023 --- /dev/null +++ b/cli/tests/lsp/code_action_response_cache.json @@ -0,0 +1,36 @@ +[ + { + "title": "Cache \"https://deno.land/x/a/mod.ts\" and its dependencies.", + "kind": "quickfix", + "diagnostics": [ + { + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 49 + } + }, + "severity": 1, + "code": "no-cache", + "source": "deno", + "message": "Unable to load the remote module: \"https://deno.land/x/a/mod.ts\".", + "data": { + "specifier": "https://deno.land/x/a/mod.ts" + } + } + ], + "command": { + "title": "", + "command": "deno.cache", + "arguments": [ + [ + "https://deno.land/x/a/mod.ts" + ] + ] + } + } +] diff --git a/cli/tests/lsp/did_open_notification_cache.json b/cli/tests/lsp/did_open_notification_cache.json new file mode 100644 index 000000000..6f21ee5cd --- /dev/null +++ b/cli/tests/lsp/did_open_notification_cache.json @@ -0,0 +1,12 @@ +{ + "jsonrpc": "2.0", + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "import * as a from \"https://deno.land/x/a/mod.ts\";\n\nconsole.log(a);\n" + } + } +} -- cgit v1.2.3