summaryrefslogtreecommitdiff
path: root/test/test_go_to_definition.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-02-15 08:54:53 +0000
committerw0rp <devw0rp@gmail.com>2019-02-15 08:54:53 +0000
commit0d10653a7c780ac98fd2b980679676f5e8f231e7 (patch)
treed8c0ad7b340dd281c725ed3a34e81f398ceec33a /test/test_go_to_definition.vader
parent89039187da89467d059cc13135e1b6cd867a68e9 (diff)
downloadale-0d10653a7c780ac98fd2b980679676f5e8f231e7.zip
Fix #2295 - Respond to initialize with an initialized message
Diffstat (limited to 'test/test_go_to_definition.vader')
-rw-r--r--test/test_go_to_definition.vader20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/test_go_to_definition.vader b/test/test_go_to_definition.vader
index 880d7123..452b7692 100644
--- a/test/test_go_to_definition.vader
+++ b/test/test_go_to_definition.vader
@@ -11,20 +11,26 @@ Before:
let g:InitCallback = v:null
runtime autoload/ale/linter.vim
+ runtime autoload/ale/lsp_linter.vim
runtime autoload/ale/lsp.vim
runtime autoload/ale/util.vim
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)
+
+ if a:linter.lsp is# 'tsserver'
+ call ale#lsp#MarkConnectionAsTsserver(g:conn_id)
+ endif
+
let l:details = {
+ \ 'command': 'foobar',
\ 'buffer': a:buffer,
\ 'connection_id': g:conn_id,
\ 'project_root': '/foo/bar',
- \ 'language_id': 'python',
\}
- let g:InitCallback = {-> a:Callback(a:linter, l:details)}
+ let g:InitCallback = {-> ale#lsp_linter#OnInit(a:linter, l:details, a:Callback)}
endfunction
function! ale#lsp#HasCapability(conn_id, capability) abort
@@ -215,7 +221,10 @@ Execute(tsserver definition requests should be sent):
\ 'function(''ale#definition#HandleTSServerResponse'')',
\ string(g:Callback)
AssertEqual
- \ [[0, 'ts@definition', {'file': expand('%:p'), 'line': 2, 'offset': 5}]],
+ \ [
+ \ ale#lsp#tsserver_message#Change(bufnr('')),
+ \ [0, 'ts@definition', {'file': expand('%:p'), 'line': 2, 'offset': 5}]
+ \ ],
\ g:message_list
AssertEqual {'42': {'open_in': 'current-buffer'}}, ale#definition#GetMap()
@@ -236,7 +245,10 @@ Execute(tsserver tab definition requests should be sent):
\ 'function(''ale#definition#HandleTSServerResponse'')',
\ string(g:Callback)
AssertEqual
- \ [[0, 'ts@definition', {'file': expand('%:p'), 'line': 2, 'offset': 5}]],
+ \ [
+ \ ale#lsp#tsserver_message#Change(bufnr('')),
+ \ [0, 'ts@definition', {'file': expand('%:p'), 'line': 2, 'offset': 5}]
+ \ ],
\ g:message_list
AssertEqual {'42': {'open_in': 'tab'}}, ale#definition#GetMap()