diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-08 22:18:28 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-08 22:18:28 +0100 |
commit | 28c6ec9cad3064966ff70c9da95c96364118eb57 (patch) | |
tree | 6d970e9455670827dced35eb59bcf62b03282775 /test/lsp/test_lsp_client_messages.vader | |
parent | cd79ced839fa2a5c3fc407d7cbe0cdf6734d17da (diff) | |
download | ale-28c6ec9cad3064966ff70c9da95c96364118eb57.zip |
#517 - Implement LSP chunked message parsing, sending messages to sockets, and callbacks
Diffstat (limited to 'test/lsp/test_lsp_client_messages.vader')
-rw-r--r-- | test/lsp/test_lsp_client_messages.vader | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/test/lsp/test_lsp_client_messages.vader b/test/lsp/test_lsp_client_messages.vader new file mode 100644 index 00000000..de18a4b8 --- /dev/null +++ b/test/lsp/test_lsp_client_messages.vader @@ -0,0 +1,78 @@ +Execute(ale#lsp#message#Initialize() should return correct messages): + AssertEqual + \ [ + \ 0, + \ 'initialize', + \ { + \ 'processId': getpid(), + \ 'rootUri': '/foo/bar', + \ 'capabilities': {}, + \ } + \ ], + \ ale#lsp#message#Initialize('/foo/bar') + +Execute(ale#lsp#message#Initialized() should return correct messages): + AssertEqual [1, 'initialized'], ale#lsp#message#Initialized() + +Execute(ale#lsp#message#Shutdown() should return correct messages): + AssertEqual [0, 'shutdown'], ale#lsp#message#Shutdown() + +Execute(ale#lsp#message#Exit() should return correct messages): + AssertEqual [1, 'exit'], ale#lsp#message#Exit(), + +Execute(ale#lsp#message#DidOpen() should return correct messages): + AssertEqual + \ [ + \ 1, + \ 'textDocument/didOpen', + \ { + \ 'textDocument': { + \ 'uri': '/foo/bar', + \ 'languageId': 'typescript', + \ 'version': 123, + \ 'text': 'foobar', + \ }, + \ } + \ ], + \ ale#lsp#message#DidOpen('/foo/bar', 'typescript', 123, 'foobar') + +Execute(ale#lsp#message#DidChange() should return correct messages): + AssertEqual + \ [ + \ 1, + \ 'textDocument/didChange', + \ { + \ 'textDocument': { + \ 'uri': '/foo/bar', + \ 'version': 123, + \ }, + \ 'contentChanges': [{'text': 'foobar'}], + \ } + \ ], + \ ale#lsp#message#DidChange('/foo/bar', 123, 'foobar') + +Execute(ale#lsp#message#DidSave() should return correct messages): + AssertEqual + \ [ + \ 1, + \ 'textDocument/didSave', + \ { + \ 'textDocument': { + \ 'uri': '/foo/bar', + \ }, + \ } + \ ], + \ ale#lsp#message#DidSave('/foo/bar') + +Execute(ale#lsp#message#DidClose() should return correct messages): + AssertEqual + \ [ + \ 1, + \ 'textDocument/didClose', + \ { + \ 'textDocument': { + \ 'uri': '/foo/bar', + \ }, + \ } + \ ], + \ ale#lsp#message#DidClose('/foo/bar') |