diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-03-16 09:01:41 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 09:01:41 +1100 |
commit | 506b321d472005d0cf916823dfa8ea37fa0b064a (patch) | |
tree | 6e4da0350772c1143a6efcfaabf99155623fe724 /cli/tests | |
parent | 2ff9b01551d4bdb3a820774252706d4e58bceaba (diff) |
refactor(lsp): refactor completions and add tests (#9789)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/lsp/completion_request.json | 18 | ||||
-rw-r--r-- | cli/tests/lsp/completion_resolve_request.json | 17 | ||||
-rw-r--r-- | cli/tests/lsp/did_open_notification_completions.json | 12 |
3 files changed, 47 insertions, 0 deletions
diff --git a/cli/tests/lsp/completion_request.json b/cli/tests/lsp/completion_request.json new file mode 100644 index 000000000..81bf719a9 --- /dev/null +++ b/cli/tests/lsp/completion_request.json @@ -0,0 +1,18 @@ +{ + "jsonrpc": "2.0", + "id": 2, + "method": "textDocument/completion", + "params": { + "textDocument": { + "uri": "file:///a/file.ts" + }, + "position": { + "line": 0, + "character": 5 + }, + "context": { + "triggerKind": 2, + "triggerCharacter": "." + } + } +} diff --git a/cli/tests/lsp/completion_resolve_request.json b/cli/tests/lsp/completion_resolve_request.json new file mode 100644 index 000000000..c176a431e --- /dev/null +++ b/cli/tests/lsp/completion_resolve_request.json @@ -0,0 +1,17 @@ +{ + "jsonrpc": "2.0", + "id": 4, + "method": "completionItem/resolve", + "params": { + "label": "build", + "kind": 6, + "sortText": "1", + "insertTextFormat": 1, + "data": { + "specifier": "file:///a/file.ts", + "position": 5, + "name": "build", + "useCodeSnippet": false + } + } +} diff --git a/cli/tests/lsp/did_open_notification_completions.json b/cli/tests/lsp/did_open_notification_completions.json new file mode 100644 index 000000000..edcdc9373 --- /dev/null +++ b/cli/tests/lsp/did_open_notification_completions.json @@ -0,0 +1,12 @@ +{ + "jsonrpc": "2.0", + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "Deno." + } + } +} |