WIP: Try and remember that the server quit
This commit is contained in:
parent
7a91518542
commit
32e16d9daf
4 changed files with 15 additions and 9 deletions
|
|
@ -40,6 +40,7 @@ endfunction
|
|||
|
||||
function! s:_Send( msg ) abort
|
||||
call ch_sendraw( s:ch, a:msg )
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! vimspector#internal#channel#Timeout( id ) abort
|
||||
|
|
|
|||
|
|
@ -43,21 +43,22 @@ endfunction
|
|||
function! s:_Send( msg ) abort
|
||||
if ! exists( 's:job' )
|
||||
echom "Can't send message: Job was not initialised correctly"
|
||||
return
|
||||
return 0
|
||||
endif
|
||||
|
||||
if job_status( s:job ) != 'run'
|
||||
echom "Can't send message: Job is not running"
|
||||
return
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ch = job_getchannel( s:job )
|
||||
if ch == 'channel fail'
|
||||
echom "Channel was closed unexpectedly!"
|
||||
return
|
||||
return 0
|
||||
endif
|
||||
|
||||
call ch_sendraw( ch, a:msg )
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! vimspector#internal#job#StartDebugSession( config ) abort
|
||||
|
|
|
|||
|
|
@ -56,11 +56,14 @@ class DebugAdapterConnection( object ):
|
|||
'timer_start( {}, "vimspector#internal#channel#Timeout" )'.format(
|
||||
timeout ) )
|
||||
|
||||
self._outstanding_requests[ this_id ] = PendingRequest( msg,
|
||||
handler,
|
||||
failure_handler,
|
||||
expiry_id )
|
||||
self._SendMessage( msg )
|
||||
request = PendingRequest( msg,
|
||||
handler,
|
||||
failure_handler,
|
||||
expiry_id )
|
||||
self._outstanding_requests[ this_id ] = request
|
||||
|
||||
if not self._SendMessage( msg ):
|
||||
self._AbortRequest( request, 'Unable to send message' )
|
||||
|
||||
def OnRequestTimeout( self, timer_id ):
|
||||
request_id = None
|
||||
|
|
@ -144,7 +147,7 @@ class DebugAdapterConnection( object ):
|
|||
|
||||
data = 'Content-Length: {0}\r\n\r\n{1}'.format( len( msg ), msg )
|
||||
# self._logger.debug( 'Sending: {0}'.format( data ) )
|
||||
self._Write( data )
|
||||
return self._Write( data )
|
||||
|
||||
def _ReadHeaders( self ):
|
||||
parts = self._buffer.split( bytes( '\r\n\r\n', 'utf-8' ), 1 )
|
||||
|
|
|
|||
|
|
@ -578,6 +578,7 @@ class DebugSession( object ):
|
|||
|
||||
def OnEvent_terminated( self, message ):
|
||||
self.Clear()
|
||||
self._connection = None
|
||||
utils.UserMessage( "Debugging was terminated." )
|
||||
|
||||
def _RemoveBreakpoints( self ):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue