summaryrefslogtreecommitdiff
path: root/test/completion/test_lsp_completion_messages.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/completion/test_lsp_completion_messages.vader')
-rw-r--r--test/completion/test_lsp_completion_messages.vader22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/completion/test_lsp_completion_messages.vader b/test/completion/test_lsp_completion_messages.vader
index f21acfb9..8ba2ad38 100644
--- a/test/completion/test_lsp_completion_messages.vader
+++ b/test/completion/test_lsp_completion_messages.vader
@@ -2,12 +2,9 @@ Before:
Save g:ale_completion_delay
Save g:ale_completion_max_suggestions
Save g:ale_completion_info
- Save g:ale_completion_experimental_lsp_support
Save &l:omnifunc
Save &l:completeopt
- unlet! g:ale_completion_experimental_lsp_support
-
let g:ale_completion_enabled = 1
call ale#test#SetDirectory('/testplugin/test/completion')
@@ -18,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
@@ -44,8 +47,9 @@ After:
unlet! b:ale_completion_parser
unlet! b:ale_complete_done_time
unlet! b:ale_linters
- unlet! g:ale_completion_experimental_lsp_support
+ unlet! b:ale_tsserver_completion_names
+ call ale#lsp#RemoveConnectionWithID(347)
call ale#test#RestoreDirectory()
call ale#linter#Reset()
@@ -116,6 +120,12 @@ Execute(The right message sent to the tsserver LSP when the first completion mes
\ ],
\})
+ " We should save the names we got in the buffer, as TSServer doesn't return
+ " details for every name.
+ AssertEqual
+ \ ['Foo', 'FooBar', 'frazzle'],
+ \ get(b:, 'ale_tsserver_completion_names', [])
+
" The entry details messages should have been sent.
AssertEqual
\ [[
@@ -136,8 +146,6 @@ Given python(Some Python file):
bazxyzxyzxyz
Execute(The right message should be sent for the initial LSP request):
- let g:ale_completion_experimental_lsp_support = 1
-
runtime ale_linters/python/pyls.vim
let b:ale_linters = ['pyls']
" The cursor position needs to match what was saved before.