summaryrefslogtreecommitdiff
path: root/test/lsp
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-02-13 00:31:33 +0000
committerw0rp <devw0rp@gmail.com>2019-02-13 17:26:37 +0000
commit1ee56713b8f9cfd0faa99dd7930437fa7ed986b0 (patch)
tree47e49ac8038f82892316e2d42a973e168c3b8d9a /test/lsp
parente88243687a2da8cd02962bc78874ec0e60aecaf2 (diff)
downloadale-1ee56713b8f9cfd0faa99dd7930437fa7ed986b0.zip
#2132 Use an on-init callback for all LSP logic
Diffstat (limited to 'test/lsp')
-rw-r--r--test/lsp/test_did_save_event.vader10
-rw-r--r--test/lsp/test_lsp_command_formatting.vader1
-rw-r--r--test/lsp/test_other_initialize_message_handling.vader2
3 files changed, 9 insertions, 4 deletions
diff --git a/test/lsp/test_did_save_event.vader b/test/lsp/test_did_save_event.vader
index f8ff8f70..1d6065ec 100644
--- a/test/lsp/test_did_save_event.vader
+++ b/test/lsp/test_did_save_event.vader
@@ -34,16 +34,19 @@ Before:
\ })
let g:ale_linters = {'foobar': ['dummy_linter']}
- function! ale#lsp_linter#StartLSP(buffer, linter) abort
+ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort
let g:conn_id = ale#lsp#Register('executable', '/foo/bar', {})
call ale#lsp#MarkDocumentAsOpen(g:conn_id, a:buffer)
-
- return {
+ let l:details = {
\ 'buffer': a:buffer,
\ 'connection_id': g:conn_id,
\ 'project_root': '/foo/bar',
\ 'language_id': 'foobar',
\}
+
+ call a:Callback(a:linter, l:details)
+
+ return 1
endfunction
" Replace the Send function for LSP, so we can monitor calls to it.
@@ -61,6 +64,7 @@ After:
unlet! b:ale_enabled
unlet! b:ale_linters
unlet! g:message_list
+ unlet! b:ale_save_event_fired
delfunction LanguageCallback
delfunction ProjectRootCallback
diff --git a/test/lsp/test_lsp_command_formatting.vader b/test/lsp/test_lsp_command_formatting.vader
index fcd4f78c..ec3b4120 100644
--- a/test/lsp/test_lsp_command_formatting.vader
+++ b/test/lsp/test_lsp_command_formatting.vader
@@ -24,6 +24,7 @@ Execute(Command formatting should be applied correctly for LSP linters):
\ 'executable': has('win32') ? 'cmd': 'true',
\ 'command': '%e --foo',
\ },
+ \ {-> 0}
\)
if has('win32')
diff --git a/test/lsp/test_other_initialize_message_handling.vader b/test/lsp/test_other_initialize_message_handling.vader
index 2f59535d..8ae63e91 100644
--- a/test/lsp/test_other_initialize_message_handling.vader
+++ b/test/lsp/test_other_initialize_message_handling.vader
@@ -10,7 +10,7 @@ Before:
\ 'config': {},
\ 'callback_list': [],
\ 'message_queue': [],
- \ 'capabilities_queue': [],
+ \ 'init_queue': [],
\ 'capabilities': {
\ 'hover': 0,
\ 'references': 0,