summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/lsp')
-rw-r--r--cli/tests/testdata/lsp/code_actions/cache_npm/cache_action.json41
-rw-r--r--cli/tests/testdata/lsp/code_actions/cache_npm/cache_response.json36
-rw-r--r--cli/tests/testdata/lsp/code_actions/cache_npm/diagnostics.json25
-rw-r--r--cli/tests/testdata/lsp/completions/npm/resolve_params.json14
-rw-r--r--cli/tests/testdata/lsp/completions/npm/resolve_response.json14
5 files changed, 130 insertions, 0 deletions
diff --git a/cli/tests/testdata/lsp/code_actions/cache_npm/cache_action.json b/cli/tests/testdata/lsp/code_actions/cache_npm/cache_action.json
new file mode 100644
index 000000000..b698df3bd
--- /dev/null
+++ b/cli/tests/testdata/lsp/code_actions/cache_npm/cache_action.json
@@ -0,0 +1,41 @@
+{
+ "textDocument": {
+ "uri": "file:///a/file.ts"
+ },
+ "range": {
+ "start": {
+ "line": 0,
+ "character": 18
+ },
+ "end": {
+ "line": 0,
+ "character": 29
+ }
+ },
+ "context": {
+ "diagnostics": [
+ {
+ "range": {
+ "start": {
+ "line": 0,
+ "character": 18
+ },
+ "end": {
+ "line": 0,
+ "character": 29
+ }
+ },
+ "severity": 1,
+ "code": "no-cache-npm",
+ "source": "deno",
+ "message": "Uncached or missing npm package: \"chalk\".",
+ "data": {
+ "specifier": "npm:chalk"
+ }
+ }
+ ],
+ "only": [
+ "quickfix"
+ ]
+ }
+}
diff --git a/cli/tests/testdata/lsp/code_actions/cache_npm/cache_response.json b/cli/tests/testdata/lsp/code_actions/cache_npm/cache_response.json
new file mode 100644
index 000000000..1b41babcb
--- /dev/null
+++ b/cli/tests/testdata/lsp/code_actions/cache_npm/cache_response.json
@@ -0,0 +1,36 @@
+[
+ {
+ "title": "Cache \"npm:chalk\" and its dependencies.",
+ "kind": "quickfix",
+ "diagnostics": [
+ {
+ "range": {
+ "start": {
+ "line": 0,
+ "character": 18
+ },
+ "end": {
+ "line": 0,
+ "character": 29
+ }
+ },
+ "severity": 1,
+ "code": "no-cache-npm",
+ "source": "deno",
+ "message": "Uncached or missing npm package: \"chalk\".",
+ "data": {
+ "specifier": "npm:chalk"
+ }
+ }
+ ],
+ "command": {
+ "title": "",
+ "command": "deno.cache",
+ "arguments": [
+ [
+ "npm:chalk"
+ ]
+ ]
+ }
+ }
+]
diff --git a/cli/tests/testdata/lsp/code_actions/cache_npm/diagnostics.json b/cli/tests/testdata/lsp/code_actions/cache_npm/diagnostics.json
new file mode 100644
index 000000000..63c9d0029
--- /dev/null
+++ b/cli/tests/testdata/lsp/code_actions/cache_npm/diagnostics.json
@@ -0,0 +1,25 @@
+{
+ "uri": "file:///a/file.ts",
+ "diagnostics": [
+ {
+ "range": {
+ "start": {
+ "line": 0,
+ "character": 18
+ },
+ "end": {
+ "line": 0,
+ "character": 29
+ }
+ },
+ "severity": 1,
+ "code": "no-cache-npm",
+ "source": "deno",
+ "message": "Uncached or missing npm package: \"chalk\".",
+ "data": {
+ "specifier": "npm:chalk"
+ }
+ }
+ ],
+ "version": 1
+}
diff --git a/cli/tests/testdata/lsp/completions/npm/resolve_params.json b/cli/tests/testdata/lsp/completions/npm/resolve_params.json
new file mode 100644
index 000000000..c83b8ce49
--- /dev/null
+++ b/cli/tests/testdata/lsp/completions/npm/resolve_params.json
@@ -0,0 +1,14 @@
+{
+ "label": "MyClass",
+ "kind": 6,
+ "sortText": "1",
+ "insertTextFormat": 1,
+ "data": {
+ "tsc": {
+ "specifier": "file:///a/file.ts",
+ "position": 69,
+ "name": "MyClass",
+ "useCodeSnippet": false
+ }
+ }
+}
diff --git a/cli/tests/testdata/lsp/completions/npm/resolve_response.json b/cli/tests/testdata/lsp/completions/npm/resolve_response.json
new file mode 100644
index 000000000..c83b8ce49
--- /dev/null
+++ b/cli/tests/testdata/lsp/completions/npm/resolve_response.json
@@ -0,0 +1,14 @@
+{
+ "label": "MyClass",
+ "kind": 6,
+ "sortText": "1",
+ "insertTextFormat": 1,
+ "data": {
+ "tsc": {
+ "specifier": "file:///a/file.ts",
+ "position": 69,
+ "name": "MyClass",
+ "useCodeSnippet": false
+ }
+ }
+}