diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-26 12:24:18 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-26 12:24:18 +0000 |
commit | b1a6abdda6f23ba314799f21c04d30e3411cebc7 (patch) | |
tree | 88a989835523ada49b909586031953f37b2f0af1 /test/completion/test_tsserver_completion_parsing.vader | |
parent | 2e50aadd56966c42cf82befaa7e4a3bac284581a (diff) | |
download | ale-b1a6abdda6f23ba314799f21c04d30e3411cebc7.zip |
#1162 Add unfinished experimental code for supporting LSP completion, clean up the tests, and make the completion cancelling better
Diffstat (limited to 'test/completion/test_tsserver_completion_parsing.vader')
-rw-r--r-- | test/completion/test_tsserver_completion_parsing.vader | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/test/completion/test_tsserver_completion_parsing.vader b/test/completion/test_tsserver_completion_parsing.vader new file mode 100644 index 00000000..b663ef40 --- /dev/null +++ b/test/completion/test_tsserver_completion_parsing.vader @@ -0,0 +1,75 @@ +Execute(TypeScript completions responses should be parsed correctly): + AssertEqual [], + \ ale#completion#ParseTSServerCompletions({ + \ 'body': [], + \}) + AssertEqual ['foo', 'bar', 'baz'], + \ ale#completion#ParseTSServerCompletions({ + \ 'body': [ + \ {'name': 'foo'}, + \ {'name': 'bar'}, + \ {'name': 'baz'}, + \ ], + \}) + +Execute(TypeScript completion details responses should be parsed correctly): + AssertEqual + \ [ + \ { + \ 'word': 'abc', + \ 'menu': '(property) Foo.abc: number', + \ 'info': '', + \ 'kind': 'f', + \ 'icase': 1, + \ }, + \ { + \ 'word': 'def', + \ 'menu': '(property) Foo.def: number', + \ 'info': 'foo bar baz', + \ 'kind': 'f', + \ 'icase': 1, + \ }, + \ ], + \ ale#completion#ParseTSServerCompletionEntryDetails({ + \ 'body': [ + \ { + \ 'name': 'abc', + \ 'kind': 'parameterName', + \ 'displayParts': [ + \ {'text': '('}, + \ {'text': 'property'}, + \ {'text': ')'}, + \ {'text': ' '}, + \ {'text': 'Foo'}, + \ {'text': '.'}, + \ {'text': 'abc'}, + \ {'text': ':'}, + \ {'text': ' '}, + \ {'text': 'number'}, + \ ], + \ }, + \ { + \ 'name': 'def', + \ 'kind': 'parameterName', + \ 'displayParts': [ + \ {'text': '('}, + \ {'text': 'property'}, + \ {'text': ')'}, + \ {'text': ' '}, + \ {'text': 'Foo'}, + \ {'text': '.'}, + \ {'text': 'def'}, + \ {'text': ':'}, + \ {'text': ' '}, + \ {'text': 'number'}, + \ ], + \ 'documentation': [ + \ {'text': 'foo'}, + \ {'text': ' '}, + \ {'text': 'bar'}, + \ {'text': ' '}, + \ {'text': 'baz'}, + \ ], + \ }, + \ ], + \}) |