Fix tracebacks when the debug adapter dies very quickly

This commit is contained in:
Ben Jackson 2020-01-02 23:55:46 +00:00
commit 37fefafe35
4 changed files with 28 additions and 14 deletions

View file

@ -30,7 +30,9 @@ endfunction
function! s:_OnExit( channel, status ) abort
echom 'Channel exit with status ' . a:status
redraw
unlet s:job
if exists( 's:job' )
unlet s:job
endif
py3 _vimspector_session.OnServerExit( vim.eval( 'a:status' ) )
endfunction
@ -61,12 +63,17 @@ function! vimspector#internal#job#StartDebugSession( config ) abort
\ }
\ )
echom 'Started job, status is: ' . job_status( s:job )
if !exists( 's:job' )
" The job died immediately after starting and we cleaned up
return v:false
endif
let status = job_status( s:job )
echom 'Started job, status is: ' . status
redraw
if job_status( s:job ) !=# 'run'
echom 'Unable to start job, status is: ' . job_status( s:job )
redraw
if status !=# 'run'
return v:false
endif
@ -140,7 +147,7 @@ function! vimspector#internal#job#StartCommandWithLog( cmd, category ) abort
\ } ) )
if job_status( s:commands[ a:category ][ index ] ) !=# 'run'
echom 'Unable to start job for ' . a:cmd
echom 'Unable to start job for ' . string( a:cmd )
redraw
return v:none
endif