summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/completion/test_lsp_completion_messages.vader9
-rw-r--r--test/lsp/test_did_save_event.vader9
-rw-r--r--test/test_engine_lsp_response_handling.vader18
-rw-r--r--test/test_find_references.vader9
-rw-r--r--test/test_go_to_definition.vader9
-rw-r--r--test/test_hover.vader2
6 files changed, 42 insertions, 14 deletions
diff --git a/test/completion/test_lsp_completion_messages.vader b/test/completion/test_lsp_completion_messages.vader
index 734b330c..8ba2ad38 100644
--- a/test/completion/test_lsp_completion_messages.vader
+++ b/test/completion/test_lsp_completion_messages.vader
@@ -15,12 +15,18 @@ Before:
let g:message_list = []
let g:Callback = ''
- function! ale#linter#StartLSP(buffer, linter, callback) abort
+ function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
let g:Callback = a:callback
+ let l:conn = ale#lsp#NewConnection({})
+ let l:conn.id = 347
+ let l:conn.open_documents = {a:buffer : -1}
+
return {
+ \ 'buffer': a:buffer,
\ 'connection_id': 347,
\ 'project_root': '/foo/bar',
+ \ 'language_id': 'python',
\}
endfunction
@@ -43,6 +49,7 @@ After:
unlet! b:ale_linters
unlet! b:ale_tsserver_completion_names
+ call ale#lsp#RemoveConnectionWithID(347)
call ale#test#RestoreDirectory()
call ale#linter#Reset()
diff --git a/test/lsp/test_did_save_event.vader b/test/lsp/test_did_save_event.vader
index 042a3ce2..97774372 100644
--- a/test/lsp/test_did_save_event.vader
+++ b/test/lsp/test_did_save_event.vader
@@ -34,12 +34,18 @@ Before:
\ })
let g:ale_linters = {'foobar': ['dummy_linter']}
- function! ale#linter#StartLSP(buffer, linter, callback) abort
+ function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
let g:Callback = a:callback
+ let l:conn = ale#lsp#NewConnection({})
+ let l:conn.id = 347
+ let l:conn.open_documents = {a:buffer : -1}
+
return {
+ \ 'buffer': a:buffer,
\ 'connection_id': 347,
\ 'project_root': '/foo/bar',
+ \ 'language_id': 'foobar',
\}
endfunction
@@ -59,6 +65,7 @@ After:
delfunction LanguageCallback
delfunction ProjectRootCallback
+ call ale#lsp#RemoveConnectionWithID(347)
call ale#test#RestoreDirectory()
call ale#linter#Reset()
diff --git a/test/test_engine_lsp_response_handling.vader b/test/test_engine_lsp_response_handling.vader
index 3d317e9c..18bad0a1 100644
--- a/test/test_engine_lsp_response_handling.vader
+++ b/test/test_engine_lsp_response_handling.vader
@@ -11,7 +11,7 @@ After:
call ale#test#RestoreDirectory()
call ale#linter#Reset()
- call ale#engine#ClearLSPData()
+ call ale#lsp_linter#ClearLSPData()
Given foobar(An empty file):
Execute(tsserver syntax error responses should be handled correctly):
@@ -21,7 +21,7 @@ Execute(tsserver syntax error responses should be handled correctly):
" When we get syntax errors and no semantic errors, we should keep the
" syntax errors.
- call ale#engine#HandleLSPResponse(1, {
+ call ale#lsp_linter#HandleLSPResponse(1, {
\ 'seq': 0,
\ 'type': 'event',
\ 'event': 'syntaxDiag',
@@ -43,7 +43,7 @@ Execute(tsserver syntax error responses should be handled correctly):
\ ],
\ },
\})
- call ale#engine#HandleLSPResponse(1, {
+ call ale#lsp_linter#HandleLSPResponse(1, {
\ 'seq': 0,
\ 'type': 'event',
\ 'event': 'semanticDiag',
@@ -71,7 +71,7 @@ Execute(tsserver syntax error responses should be handled correctly):
\ getloclist(0)
" After we get empty syntax errors, we should clear them.
- call ale#engine#HandleLSPResponse(1, {
+ call ale#lsp_linter#HandleLSPResponse(1, {
\ 'seq': 0,
\ 'type': 'event',
\ 'event': 'syntaxDiag',
@@ -94,7 +94,7 @@ Execute(tsserver semantic error responses should be handled correctly):
" When we get syntax errors and no semantic errors, we should keep the
" syntax errors.
- call ale#engine#HandleLSPResponse(1, {
+ call ale#lsp_linter#HandleLSPResponse(1, {
\ 'seq': 0,
\ 'type': 'event',
\ 'event': 'syntaxDiag',
@@ -104,7 +104,7 @@ Execute(tsserver semantic error responses should be handled correctly):
\ ],
\ },
\})
- call ale#engine#HandleLSPResponse(1, {
+ call ale#lsp_linter#HandleLSPResponse(1, {
\ 'seq': 0,
\ 'type': 'event',
\ 'event': 'semanticDiag',
@@ -144,7 +144,7 @@ Execute(tsserver semantic error responses should be handled correctly):
\ getloclist(0)
" After we get empty syntax errors, we should clear them.
- call ale#engine#HandleLSPResponse(1, {
+ call ale#lsp_linter#HandleLSPResponse(1, {
\ 'seq': 0,
\ 'type': 'event',
\ 'event': 'semanticDiag',
@@ -161,8 +161,8 @@ Execute(tsserver semantic error responses should be handled correctly):
\ getloclist(0)
Execute(LSP errors should be logged in the history):
- call ale#engine#SetLSPLinterMap({'347': 'foobar'})
- call ale#engine#HandleLSPResponse(347, {
+ call ale#lsp_linter#SetLSPLinterMap({'347': 'foobar'})
+ call ale#lsp_linter#HandleLSPResponse(347, {
\ 'jsonrpc': '2.0',
\ 'error': {
\ 'code': -32602,
diff --git a/test/test_find_references.vader b/test/test_find_references.vader
index 6ab8e8fb..c2290ca3 100644
--- a/test/test_find_references.vader
+++ b/test/test_find_references.vader
@@ -14,12 +14,18 @@ Before:
runtime autoload/ale/util.vim
runtime autoload/ale/preview.vim
- function! ale#linter#StartLSP(buffer, linter, callback) abort
+ function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
let g:Callback = a:callback
+ let l:conn = ale#lsp#NewConnection({})
+ let l:conn.id = 347
+ let l:conn.open_documents = {a:buffer : -1}
+
return {
+ \ 'buffer': a:buffer,
\ 'connection_id': 347,
\ 'project_root': '/foo/bar',
+ \ 'language_id': 'python',
\}
endfunction
@@ -39,6 +45,7 @@ Before:
endfunction
After:
+ call ale#lsp#RemoveConnectionWithID(347)
call ale#references#SetMap({})
call ale#test#RestoreDirectory()
call ale#linter#Reset()
diff --git a/test/test_go_to_definition.vader b/test/test_go_to_definition.vader
index 6af97099..3a1d7458 100644
--- a/test/test_go_to_definition.vader
+++ b/test/test_go_to_definition.vader
@@ -11,12 +11,18 @@ Before:
runtime autoload/ale/lsp.vim
runtime autoload/ale/util.vim
- function! ale#linter#StartLSP(buffer, linter, callback) abort
+ function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
let g:Callback = a:callback
+ let l:conn = ale#lsp#NewConnection({})
+ let l:conn.id = 347
+ let l:conn.open_documents = {a:buffer : -1}
+
return {
+ \ 'buffer': a:buffer,
\ 'connection_id': 347,
\ 'project_root': '/foo/bar',
+ \ 'language_id': 'python',
\}
endfunction
@@ -31,6 +37,7 @@ Before:
endfunction
After:
+ call ale#lsp#RemoveConnectionWithID(347)
call ale#definition#SetMap({})
call ale#test#RestoreDirectory()
call ale#linter#Reset()
diff --git a/test/test_hover.vader b/test/test_hover.vader
index 18dcebaf..15f164f0 100644
--- a/test/test_hover.vader
+++ b/test/test_hover.vader
@@ -11,7 +11,7 @@ Before:
runtime autoload/ale/lsp.vim
runtime autoload/ale/util.vim
- function! ale#linter#StartLSP(buffer, linter, callback) abort
+ function! ale#lsp_linter#StartLSP(buffer, linter, callback) abort
let g:Callback = a:callback
return {