diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-02-12 15:17:48 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-12 15:17:48 +1100 |
commit | d6c05b09dd7cbaba0fcae65929a2c2dd55e9d994 (patch) | |
tree | 1d813f7f0acc543f6da96c429a5cc2fd19b606f1 /cli/tests | |
parent | 46da7c6aff3c10af6a067f4229644d2de444a3a7 (diff) |
feat(lsp): add deno cache code actions (#9471)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/lsp/code_action_request_cache.json | 46 | ||||
-rw-r--r-- | cli/tests/lsp/code_action_response_cache.json | 36 | ||||
-rw-r--r-- | cli/tests/lsp/did_open_notification_cache.json | 12 |
3 files changed, 94 insertions, 0 deletions
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" + } + } +} |