diff options
author | Bjorn Neergaard <bjorn@neersighted.com> | 2018-11-29 14:57:35 -0700 |
---|---|---|
committer | Bjorn Neergaard <bjorn@neersighted.com> | 2018-11-29 14:57:35 -0700 |
commit | d2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch) | |
tree | bb8145e69bf1bcb8968b29cb1a68c47ceb83674d /test/test_find_references.vader | |
parent | ef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff) | |
parent | 0a384a49d371838903d8401c5358ec60f3f4266d (diff) | |
download | ale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip |
Merge branch 'master' into sridhars
Diffstat (limited to 'test/test_find_references.vader')
-rw-r--r-- | test/test_find_references.vader | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/test/test_find_references.vader b/test/test_find_references.vader index ecced068..88b2d762 100644 --- a/test/test_find_references.vader +++ b/test/test_find_references.vader @@ -9,6 +9,7 @@ Before: let g:preview_called = 0 let g:item_list = [] let g:capability_checked = '' + let g:conn_id = v:null let g:WaitCallback = v:null runtime autoload/ale/linter.vim @@ -17,19 +18,18 @@ Before: runtime autoload/ale/preview.vim function! ale#lsp_linter#StartLSP(buffer, linter) abort - let l:conn = ale#lsp#NewConnection({}) - let l:conn.id = 347 - let l:conn.open_documents = {a:buffer : -1} + let g:conn_id = ale#lsp#Register('executable', '/foo/bar', {}) + call ale#lsp#MarkDocumentAsOpen(g:conn_id, a:buffer) return { \ 'buffer': a:buffer, - \ 'connection_id': 347, + \ 'connection_id': g:conn_id, \ 'project_root': '/foo/bar', \ 'language_id': 'python', \} endfunction - function! ale#lsp#WaitForCapability(conn_id, project_root, capability, callback) abort + function! ale#lsp#WaitForCapability(conn_id, capability, callback) abort let g:capability_checked = a:capability let g:WaitCallback = a:callback endfunction @@ -38,7 +38,7 @@ Before: let g:Callback = a:callback endfunction - function! ale#lsp#Send(conn_id, message, root) abort + function! ale#lsp#Send(conn_id, message) abort call add(g:message_list, a:message) return 42 @@ -54,7 +54,10 @@ Before: endfunction After: - call ale#lsp#RemoveConnectionWithID(347) + if g:conn_id isnot v:null + call ale#lsp#RemoveConnectionWithID(g:conn_id) + endif + call ale#references#SetMap({}) call ale#test#RestoreDirectory() call ale#linter#Reset() @@ -62,6 +65,7 @@ After: unlet! g:capability_checked unlet! g:WaitCallback unlet! g:old_filename + unlet! g:conn_id unlet! g:Callback unlet! g:message_list unlet! g:expr_list @@ -168,7 +172,7 @@ Execute(tsserver reference requests should be sent): AssertEqual type(function('type')), type(g:WaitCallback) AssertEqual 'references', g:capability_checked - call call(g:WaitCallback, [347, '/foo/bar']) + call call(g:WaitCallback, [g:conn_id, '/foo/bar']) AssertEqual \ 'function(''ale#references#HandleTSServerResponse'')', @@ -249,7 +253,7 @@ Execute(LSP reference requests should be sent): AssertEqual type(function('type')), type(g:WaitCallback) AssertEqual 'references', g:capability_checked - call call(g:WaitCallback, [347, '/foo/bar']) + call call(g:WaitCallback, [g:conn_id, '/foo/bar']) AssertEqual \ 'function(''ale#references#HandleLSPResponse'')', |