summaryrefslogtreecommitdiff
path: root/test/lsp/test_lsp_connections.vader
diff options
context:
space:
mode:
authorsridhars <sridhars@users.noreply.github.com>2018-07-24 16:42:26 -0500
committerGitHub <noreply@github.com>2018-07-24 16:42:26 -0500
commit4446cf15bea403204b5097f1bfc74267af32553c (patch)
tree325b0370a3b511efa2a498ee6959fe16c56c1b20 /test/lsp/test_lsp_connections.vader
parent0da4c6e4ad009a37b482d301a19b6d024aa0ae0a (diff)
parent341857477011f703664b31d8d76f6872f8399c66 (diff)
downloadale-4446cf15bea403204b5097f1bfc74267af32553c.zip
Merge pull request #1 from w0rp/master
update
Diffstat (limited to 'test/lsp/test_lsp_connections.vader')
-rw-r--r--test/lsp/test_lsp_connections.vader34
1 files changed, 22 insertions, 12 deletions
diff --git a/test/lsp/test_lsp_connections.vader b/test/lsp/test_lsp_connections.vader
index 8651d801..ae64eadb 100644
--- a/test/lsp/test_lsp_connections.vader
+++ b/test/lsp/test_lsp_connections.vader
@@ -2,6 +2,10 @@ Before:
let g:ale_lsp_next_message_id = 1
After:
+ if exists('b:conn') && has_key(b:conn, 'id')
+ call ale#lsp#RemoveConnectionWithID(b:conn.id)
+ endif
+
unlet! b:data
unlet! b:conn
@@ -223,17 +227,20 @@ Execute(ale#lsp#ReadMessageData() should handle a message with part of a second
\ )
Execute(Projects with regular project roots should be registered correctly):
- let b:conn = {'projects': {}}
-
- call ale#lsp#RegisterProject(b:conn, '/foo/bar')
+ let b:conn = ale#lsp#NewConnection({})
+ call ale#lsp#RegisterProject(b:conn.id, '/foo/bar')
AssertEqual
\ {
- \ 'projects': {
- \ '/foo/bar': {'initialized': 0, 'message_queue': [], 'init_request_id': 0},
+ \ '/foo/bar': {
+ \ 'root': '/foo/bar',
+ \ 'initialized': 0,
+ \ 'message_queue': [],
+ \ 'capabilities_queue': [],
+ \ 'init_request_id': 0,
\ },
\ },
- \ b:conn
+ \ b:conn.projects
Execute(Projects with regular project roots should be fetched correctly):
let b:conn = {
@@ -247,17 +254,20 @@ Execute(Projects with regular project roots should be fetched correctly):
\ ale#lsp#GetProject(b:conn, '/foo/bar')
Execute(Projects with empty project roots should be registered correctly):
- let b:conn = {'projects': {}}
-
- call ale#lsp#RegisterProject(b:conn, '')
+ let b:conn = ale#lsp#NewConnection({})
+ call ale#lsp#RegisterProject(b:conn.id, '')
AssertEqual
\ {
- \ 'projects': {
- \ '<<EMPTY>>': {'initialized': 1, 'message_queue': [], 'init_request_id': 0},
+ \ '<<EMPTY>>': {
+ \ 'root': '',
+ \ 'initialized': 1,
+ \ 'message_queue': [],
+ \ 'capabilities_queue': [],
+ \ 'init_request_id': 0,
\ },
\ },
- \ b:conn
+ \ b:conn.projects
Execute(Projects with empty project roots should be fetched correctly):
let b:conn = {