mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
Add env (#1292)
* passing env to lsp#utils#job#start * passing env to lsp#client#start * env for only cmd * do not need to add * possible to specify env for the server * update job.vim
This commit is contained in:
@@ -452,14 +452,17 @@ function! s:ensure_start(buf, server_name, cb) abort
|
||||
endif
|
||||
|
||||
call lsp#log('Starting server', a:server_name, l:cmd)
|
||||
|
||||
let l:lsp_id = lsp#client#start({
|
||||
\ 'cmd': l:cmd,
|
||||
\ 'on_stderr': function('s:on_stderr', [a:server_name]),
|
||||
\ 'on_exit': function('s:on_exit', [a:server_name]),
|
||||
\ 'on_notification': function('s:on_notification', [a:server_name]),
|
||||
\ 'on_request': function('s:on_request', [a:server_name]),
|
||||
\ })
|
||||
let l:opts = {
|
||||
\ 'cmd': l:cmd,
|
||||
\ 'on_stderr': function('s:on_stderr', [a:server_name]),
|
||||
\ 'on_exit': function('s:on_exit', [a:server_name]),
|
||||
\ 'on_notification': function('s:on_notification', [a:server_name]),
|
||||
\ 'on_request': function('s:on_request', [a:server_name]),
|
||||
\ }
|
||||
if has_key(l:server_info, 'env')
|
||||
let l:opts.env = l:server_info.env
|
||||
endif
|
||||
let l:lsp_id = lsp#client#start(l:opts)
|
||||
endif
|
||||
|
||||
if l:lsp_id > 0
|
||||
|
||||
Reference in New Issue
Block a user