diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-04-01 20:18:51 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 20:18:51 +1100 |
commit | ec6317e8944d87cb412128f44fe4bb4c2a2d136f (patch) | |
tree | dfe91598fb706fde6455c127d0d655af0faaf56e /cli/tests | |
parent | 47ac654ea27e22d328921dd2283953dfd675b427 (diff) |
fix(lsp): ensure insert_text is passed back on completions (#9951)
Fixes #9920
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/lsp/completion_request_optional.json | 18 | ||||
-rw-r--r-- | cli/tests/lsp/completion_resolve_request_optional.json | 20 | ||||
-rw-r--r-- | cli/tests/lsp/did_open_notification_completion_optional.json | 12 |
3 files changed, 50 insertions, 0 deletions
diff --git a/cli/tests/lsp/completion_request_optional.json b/cli/tests/lsp/completion_request_optional.json new file mode 100644 index 000000000..5e86c33ff --- /dev/null +++ b/cli/tests/lsp/completion_request_optional.json @@ -0,0 +1,18 @@ +{ + "jsonrpc": "2.0", + "id": 2, + "method": "textDocument/completion", + "params": { + "textDocument": { + "uri": "file:///a/file.ts" + }, + "position": { + "line": 8, + "character": 4 + }, + "context": { + "triggerKind": 2, + "triggerCharacter": "." + } + } +} diff --git a/cli/tests/lsp/completion_resolve_request_optional.json b/cli/tests/lsp/completion_resolve_request_optional.json new file mode 100644 index 000000000..ffa60b919 --- /dev/null +++ b/cli/tests/lsp/completion_resolve_request_optional.json @@ -0,0 +1,20 @@ +{ + "jsonrpc": "2.0", + "id": 4, + "method": "completionItem/resolve", + "params": { + "label": "b?", + "kind": 5, + "sortText": "1", + "filterText": "b", + "insertText": "b", + "data": { + "tsc": { + "specifier": "file:///a/file.ts", + "position": 79, + "name": "b", + "useCodeSnippet": false + } + } + } +} diff --git a/cli/tests/lsp/did_open_notification_completion_optional.json b/cli/tests/lsp/did_open_notification_completion_optional.json new file mode 100644 index 000000000..5e919c80a --- /dev/null +++ b/cli/tests/lsp/did_open_notification_completion_optional.json @@ -0,0 +1,12 @@ +{ + "jsonrpc": "2.0", + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "interface A {\n b?: string;\n}\n\nconst o: A = {};\n\nfunction c(s: string) {}\n\nc(o.)" + } + } +} |