mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00
use provider#stderr_collector
This commit is contained in:
@@ -3,16 +3,7 @@ if exists('g:loaded_node_provider')
|
|||||||
endif
|
endif
|
||||||
let g:loaded_node_provider = 1
|
let g:loaded_node_provider = 1
|
||||||
|
|
||||||
let s:stderr = {}
|
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
|
||||||
let s:job_opts = {'rpc': v:true}
|
|
||||||
|
|
||||||
function! s:job_opts.on_stderr(chan_id, data, event)
|
|
||||||
let stderr = get(s:stderr, a:chan_id, [''])
|
|
||||||
let last = remove(stderr, -1)
|
|
||||||
let a:data[0] = last.a:data[0]
|
|
||||||
call extend(stderr, a:data)
|
|
||||||
let s:stderr[a:chan_id] = stderr
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! provider#node#Detect() abort
|
function! provider#node#Detect() abort
|
||||||
return exepath('neovim-node-host')
|
return exepath('neovim-node-host')
|
||||||
@@ -44,10 +35,13 @@ function! provider#node#Require(host) abort
|
|||||||
catch
|
catch
|
||||||
echomsg v:throwpoint
|
echomsg v:throwpoint
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
for row in get(s:stderr, channel_id, [])
|
for row in provider#get_stderr(channel_id)
|
||||||
echomsg row
|
echomsg row
|
||||||
endfor
|
endfor
|
||||||
endtry
|
endtry
|
||||||
|
finally
|
||||||
|
call provider#clear_stderr(channel_id)
|
||||||
|
endtry
|
||||||
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE')
|
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user