diff options
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r-- | cli/tests/testdata/lsp/code_action_params_import_assertion.json | 38 | ||||
-rw-r--r-- | cli/tests/testdata/lsp/code_action_response_import_assertion.json | 43 |
2 files changed, 81 insertions, 0 deletions
diff --git a/cli/tests/testdata/lsp/code_action_params_import_assertion.json b/cli/tests/testdata/lsp/code_action_params_import_assertion.json new file mode 100644 index 000000000..67b822a42 --- /dev/null +++ b/cli/tests/testdata/lsp/code_action_params_import_assertion.json @@ -0,0 +1,38 @@ +{ + "textDocument": { + "uri": "file:///a/a.ts" + }, + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 27 + } + }, + "context": { + "diagnostics": [ + { + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 27 + } + }, + "severity": 1, + "code": "no-assert-type", + "source": "deno", + "message": "The module is a JSON module and not being imported with an import assertion. Consider adding `assert { type: \"json\" }` to the import statement." + } + ], + "only": [ + "quickfix" + ] + } +} diff --git a/cli/tests/testdata/lsp/code_action_response_import_assertion.json b/cli/tests/testdata/lsp/code_action_response_import_assertion.json new file mode 100644 index 000000000..bff934b21 --- /dev/null +++ b/cli/tests/testdata/lsp/code_action_response_import_assertion.json @@ -0,0 +1,43 @@ +[ + { + "title": "Insert import assertion.", + "kind": "quickfix", + "diagnostics": [ + { + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 27 + } + }, + "severity": 1, + "code": "no-assert-type", + "source": "deno", + "message": "The module is a JSON module and not being imported with an import assertion. Consider adding `assert { type: \"json\" }` to the import statement." + } + ], + "edit": { + "changes": { + "file:///a/a.ts": [ + { + "range": { + "start": { + "line": 0, + "character": 27 + }, + "end": { + "line": 0, + "character": 27 + } + }, + "newText": " assert { type: \"json\" }" + } + ] + } + } + } +] |