#649 Output the tsserver command in ALEInfo
This commit is contained in:
parent
07af1799b1
commit
25e4d1a353
@ -538,9 +538,22 @@ function! s:CheckWithTSServer(buffer, linter, executable) abort
|
|||||||
let l:open_documents = l:info.open_lsp_documents
|
let l:open_documents = l:info.open_lsp_documents
|
||||||
let l:is_open = index(l:open_documents, a:linter.name) >= 0
|
let l:is_open = index(l:open_documents, a:linter.name) >= 0
|
||||||
|
|
||||||
call ale#lsp#StartProgram(a:executable, a:executable, function('s:HandleLSPResponse'))
|
let l:command = ale#job#PrepareCommand(a:executable)
|
||||||
|
let l:job_id = ale#lsp#StartProgram(a:executable, l:command, function('s:HandleLSPResponse'))
|
||||||
|
|
||||||
|
if !l:job_id
|
||||||
|
if g:ale_history_enabled
|
||||||
|
call ale#history#Add(a:buffer, 'failed', l:job_id, l:command)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if !l:is_open
|
if !l:is_open
|
||||||
|
if g:ale_history_enabled
|
||||||
|
call ale#history#Add(a:buffer, 'started', l:job_id, l:command)
|
||||||
|
endif
|
||||||
|
|
||||||
call add(l:open_documents, a:linter.name)
|
call add(l:open_documents, a:linter.name)
|
||||||
call ale#lsp#SendMessageToProgram(
|
call ale#lsp#SendMessageToProgram(
|
||||||
\ a:executable,
|
\ a:executable,
|
||||||
|
@ -162,6 +162,9 @@ function! s:HandleCommandMessage(job_id, message) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Start a program for LSP servers which run with executables.
|
" Start a program for LSP servers which run with executables.
|
||||||
|
"
|
||||||
|
" The job ID will be returned for for the program if it ran, otherwise
|
||||||
|
" 0 will be returned.
|
||||||
function! ale#lsp#StartProgram(executable, command, callback) abort
|
function! ale#lsp#StartProgram(executable, command, callback) abort
|
||||||
if !executable(a:executable)
|
if !executable(a:executable)
|
||||||
return 0
|
return 0
|
||||||
@ -179,7 +182,7 @@ function! ale#lsp#StartProgram(executable, command, callback) abort
|
|||||||
\ 'mode': 'raw',
|
\ 'mode': 'raw',
|
||||||
\ 'out_cb': function('s:HandleCommandMessage'),
|
\ 'out_cb': function('s:HandleCommandMessage'),
|
||||||
\}
|
\}
|
||||||
let l:job_id = ale#job#Start(ale#job#PrepareCommand(a:command), l:options)
|
let l:job_id = ale#job#Start(a:command, l:options)
|
||||||
else
|
else
|
||||||
let l:job_id = l:conn.job_id
|
let l:job_id = l:conn.job_id
|
||||||
endif
|
endif
|
||||||
@ -190,7 +193,7 @@ function! ale#lsp#StartProgram(executable, command, callback) abort
|
|||||||
|
|
||||||
let l:conn.job_id = l:job_id
|
let l:conn.job_id = l:job_id
|
||||||
|
|
||||||
return 1
|
return l:job_id
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Send a message to a server with a given executable, and a command for
|
" Send a message to a server with a given executable, and a command for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user