Use the same version as the current macvim
This commit is contained in:
parent
de3c513b24
commit
d458d06bc5
12 changed files with 733 additions and 4 deletions
|
|
@ -27,14 +27,17 @@ endfunction
|
|||
|
||||
function! s:_OnServerError( channel, data ) abort
|
||||
echom 'Channel received error: ' . a:data
|
||||
redraw
|
||||
endfunction
|
||||
|
||||
function! s:_OnExit( channel, status ) abort
|
||||
echom 'Channel exit with status ' . a:status
|
||||
redraw
|
||||
endfunction
|
||||
|
||||
function! s:_OnClose( channel ) abort
|
||||
echom 'Channel closed'
|
||||
redraw
|
||||
" py3 _vimspector_session.OnChannelClosed()
|
||||
endfunction
|
||||
|
||||
|
|
@ -68,6 +71,7 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort
|
|||
|
||||
if ch_status( s:ch ) !=# 'open'
|
||||
echom 'Unable to connect to debug adapter'
|
||||
redraw
|
||||
return v:none
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -29,28 +29,33 @@ endfunction
|
|||
|
||||
function! s:_OnExit( channel, status ) abort
|
||||
echom 'Channel exit with status ' . a:status
|
||||
redraw
|
||||
unlet s:job
|
||||
py3 _vimspector_session.OnServerExit( vim.eval( 'a:status' ) )
|
||||
endfunction
|
||||
|
||||
function! s:_OnClose( channel ) abort
|
||||
echom 'Channel closed'
|
||||
redraw
|
||||
endfunction
|
||||
|
||||
function! s:_Send( msg ) abort
|
||||
if ! exists( 's:job' )
|
||||
echom "Can't send message: Job was not initialised correctly"
|
||||
redraw
|
||||
return 0
|
||||
endif
|
||||
|
||||
if job_status( s:job ) !=# 'run'
|
||||
echom "Can't send message: Job is not running"
|
||||
redraw
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ch = job_getchannel( s:job )
|
||||
if ch ==# 'channel fail'
|
||||
echom 'Channel was closed unexpectedly!'
|
||||
redraw
|
||||
return 0
|
||||
endif
|
||||
|
||||
|
|
@ -61,6 +66,7 @@ endfunction
|
|||
function! vimspector#internal#job#StartDebugSession( config ) abort
|
||||
if exists( 's:job' )
|
||||
echom 'Not starging: Job is already running'
|
||||
redraw
|
||||
return v:none
|
||||
endif
|
||||
|
||||
|
|
@ -80,9 +86,11 @@ function! vimspector#internal#job#StartDebugSession( config ) abort
|
|||
\ )
|
||||
|
||||
echom 'Started job, status is: ' . job_status( s:job )
|
||||
redraw
|
||||
|
||||
if job_status( s:job ) !=# 'run'
|
||||
echom 'Unable to start job, status is: ' . job_status( s:job )
|
||||
redraw
|
||||
return v:none
|
||||
endif
|
||||
|
||||
|
|
@ -92,11 +100,13 @@ endfunction
|
|||
function! vimspector#internal#job#StopDebugSession() abort
|
||||
if !exists( 's:job' )
|
||||
echom "Not stopping session: Job doesn't exist"
|
||||
redraw
|
||||
return
|
||||
endif
|
||||
|
||||
if job_status( s:job ) ==# 'run'
|
||||
echom 'Terminating job'
|
||||
redraw
|
||||
call job_stop( s:job, 'kill' )
|
||||
endif
|
||||
endfunction
|
||||
|
|
@ -140,6 +150,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
|
||||
redraw
|
||||
return v:none
|
||||
endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue