Add timeout for requests.

This commit is contained in:
Ben Jackson 2018-12-20 15:10:24 +00:00
commit af338669f3
4 changed files with 77 additions and 15 deletions

View file

@ -42,6 +42,12 @@ function! s:_Send( msg ) abort
call ch_sendraw( s:ch, a:msg )
endfunction
function! vimspector#internal#channel#Timeout( id ) abort
py3 << EOF
_vimspector_session.OnRequestTimeout( vim.eval( 'a:id' ) )
EOF
endfunction
function! vimspector#internal#channel#StartDebugSession( config ) abort
if exists( 's:ch' )

View file

@ -55,7 +55,7 @@ endfunction
function! vimspector#internal#job#StartDebugSession( config ) abort
if exists( 's:job' )
echo "Job is already running"
echom "Job is already running"
return v:none
endif
@ -81,6 +81,10 @@ function! vimspector#internal#job#StartDebugSession( config ) abort
endfunction
function! vimspector#internal#job#StopDebugSession() abort
if ! exists( 's:job' )
return
endfunction
if job_status( s:job ) == 'run'
call job_stop( s:job, 'term' )
endif