From fb2bad216f40bc72eff9310df4243e583f4eb184 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 3 Dec 2020 20:42:32 +0000 Subject: [PATCH 01/47] Add a session ID to debug_session - vim only for now --- autoload/vimspector/internal/channel.vim | 90 ++++++++------ autoload/vimspector/internal/job.vim | 116 +++++++++++------- autoload/vimspector/internal/neochannel.vim | 57 +++++---- autoload/vimspector/internal/neojob.vim | 96 +++++++++------ .../vimspector/debug_adapter_connection.py | 7 +- python3/vimspector/debug_session.py | 31 ++++- python3/vimspector/output.py | 5 +- python3/vimspector/utils.py | 23 ++-- python3/vimspector/variables.py | 5 +- .../test/python/simple_python/print_env.py | 3 +- tests/language_python.test.vim | 43 +++++++ 11 files changed, 320 insertions(+), 156 deletions(-) diff --git a/autoload/vimspector/internal/channel.vim b/autoload/vimspector/internal/channel.vim index e033cff..fb97b19 100644 --- a/autoload/vimspector/internal/channel.vim +++ b/autoload/vimspector/internal/channel.vim @@ -19,8 +19,12 @@ let s:save_cpo = &cpoptions set cpoptions&vim " }}} -function! s:_OnServerData( channel, data ) abort - if !exists( 's:ch' ) || s:ch isnot a:channel +let s:channels = {} +let s:jobs = {} + +function! s:_OnServerData( session_id, channel, data ) abort + if !has_key( s:channels, a:session_id ) || + \ s:channels[ a:session_id ] isnot a:channel return endif @@ -29,20 +33,23 @@ _vimspector_session.OnChannelData( vim.eval( 'a:data' ) ) EOF endfunction -function! s:_OnClose( channel ) abort - if !exists( 's:ch' ) || s:ch isnot a:channel +function! s:_OnClose( session_id, channel ) abort + if !has_key( s:channels, a:session_id ) || + \ s:channels[ a:session_id ] isnot a:channel return endif echom 'Channel closed' redraw - unlet s:ch + unlet s:channels[ a:session_id ] py3 _vimspector_session.OnServerExit( 0 ) endfunction -function! vimspector#internal#channel#StartDebugSession( config ) abort +function! vimspector#internal#channel#StartDebugSession( + \ session_id, + \ config ) abort - if exists( 's:ch' ) + if has_key( s:channels, a:session_id ) echo 'Channel is already running' return v:false endif @@ -50,7 +57,7 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort " If we _also_ have a command line, then start the actual job. This allows for " servers which start up and listen on some port if has_key( a:config, 'command' ) - let s:job = job_start( a:config[ 'command' ], + let s:jobs[ a:session_id ] = job_start( a:config[ 'command' ], \ { \ 'in_mode': 'raw', \ 'out_mode': 'raw', @@ -65,16 +72,19 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort let l:addr = get( a:config, 'host', '127.0.0.1' ) . ':' . a:config[ 'port' ] echo 'Connecting to ' . l:addr . '... (waiting fo up to 10 seconds)' - let s:ch = ch_open( l:addr, + " FIXME: This _always_ waits 10s; the neochannel version is quicker + let s:channels[ a:session_id ] = ch_open( l:addr, \ { \ 'mode': 'raw', - \ 'callback': funcref( 's:_OnServerData' ), - \ 'close_cb': funcref( 's:_OnClose' ), + \ 'callback': funcref( 's:_OnServerData', + \ [ a:session_id ] ), + \ 'close_cb': funcref( 's:_OnClose', + \ [ a:session_id ] ), \ 'waittime': 10000, \ } \ ) - if ch_status( s:ch ) !=# 'open' + if ch_status( s:channels[ a:session_id ] ) !=# 'open' echom 'Unable to connect to' l:addr redraw return v:false @@ -83,62 +93,68 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort return v:true endfunction -function! vimspector#internal#channel#Send( msg ) abort - call ch_sendraw( s:ch, a:msg ) +function! vimspector#internal#channel#Send( session_id, msg ) abort + call ch_sendraw( s:channels[ a:session_id ], a:msg ) return 1 endfunction -function! vimspector#internal#channel#Timeout( id ) abort +function! vimspector#internal#channel#Timeout( session_id, id ) abort py3 << EOF _vimspector_session.OnRequestTimeout( vim.eval( 'a:id' ) ) EOF endfunction -function! vimspector#internal#channel#StopDebugSession() abort +function! s:_ChannelExists( session_id ) abort + return has_key( s:channels, a:session_id ) && + \ count( [ 'closed', 'fail' ], + \ ch_status( s:channels[ a:session_id ] ) ) == 0 +endfunction - if exists( 's:job' ) +function! vimspector#internal#channel#StopDebugSession( session_id ) abort + + if has_key( s:jobs, a:session_id ) " We started the job, so we need to kill it and wait to read all the data " from the socket - if job_status( s:job ) ==# 'run' - call job_stop( s:job, 'term' ) + let job = s:jobs[ a:session_id ] + if job_status( job ) ==# 'run' + call job_stop( job, 'term' ) endif - while job_status( s:job ) ==# 'run' - call job_stop( s:job, 'kill' ) + while job_status( job ) ==# 'run' + call job_stop( job, 'kill' ) endwhile - unlet s:job + call remove( s:jobs, a:session_id ) - if exists( 's:ch' ) && count( [ 'closed', 'fail' ], ch_status( s:ch ) ) == 0 + if s:_ChannelExists( a:session_id ) " We're going to block on this channel reading, then manually call the " close callback, so remove the automatic close callback to avoid tricky " re-entrancy - call ch_setoptions( s:ch, { 'close_cb': '' } ) + call ch_setoptions( s:channels[ a:session_id ], { 'close_cb': '' } ) endif - - elseif exists( 's:ch' ) && - \ count( [ 'closed', 'fail' ], ch_status( s:ch ) ) == 0 - + elseif s:_ChannelExists( a:session_id ) " channel is open, close it and trigger the callback. The callback is _not_ " triggered when manually calling ch_close. if we get here and the channel " is not open, then we there is a _OnClose callback waiting for us, so do " nothing. - call ch_close( s:ch ) + call ch_close( s:channels[ a:session_id ] ) endif " block until we've read all data from the socket and handled it. - while count( [ 'open', 'buffered' ], ch_status( s:ch ) ) == 1 - let data = ch_read( s:ch, { 'timeout': 10 } ) - call s:_OnServerData( s:ch, data ) + while has_key( s:channels, a:session_id ) && + \ count( [ 'open', 'buffered' ], + \ ch_status( s:channels[ a:session_id ] ) ) == 1 + let data = ch_read( s:channels[ a:session_id ], { 'timeout': 10 } ) + call s:_OnServerData( s:channels[ a:session_id ], data ) endwhile - call s:_OnClose( s:ch ) + if has_key( s:channels, a:session_id ) + call s:_OnClose( s:channels[ a:session_id ] ) + endif endfunction -function! vimspector#internal#channel#Reset() abort - if exists( 's:ch' ) || exists( 's:job' ) - call vimspector#internal#channel#StopDebugSession() - endif +function! vimspector#internal#channel#Reset( session_id ) abort + call vimspector#internal#channel#StopDebugSession( a:session_id ) endfunction " Boilerplate {{{ diff --git a/autoload/vimspector/internal/job.vim b/autoload/vimspector/internal/job.vim index 206baf0..39dca29 100644 --- a/autoload/vimspector/internal/job.vim +++ b/autoload/vimspector/internal/job.vim @@ -19,8 +19,12 @@ let s:save_cpo = &cpoptions set cpoptions&vim " }}} -function! s:_OnServerData( channel, data ) abort - if !exists( 's:job' ) || ch_getjob( a:channel ) isnot s:job +let s:jobs = {} +let s:commands = {} + +function! s:_OnServerData( session_id, channel, data ) abort + if !has_key( s:jobs, a:session_id ) || + \ ch_getjob( a:channel ) isnot s:jobs[ a:session_id ] call ch_log( 'Get data after process exit' ) return endif @@ -28,8 +32,9 @@ function! s:_OnServerData( channel, data ) abort py3 _vimspector_session.OnChannelData( vim.eval( 'a:data' ) ) endfunction -function! s:_OnServerError( channel, data ) abort - if !exists( 's:job' ) || ch_getjob( a:channel ) isnot s:job +function! s:_OnServerError( session_id, channel, data ) abort + if !has_key( s:jobs, a:session_id ) || + \ ch_getjob( a:channel ) isnot s:jobs[ a:session_id ] call ch_log( 'Get data after process exit' ) return endif @@ -41,22 +46,24 @@ endfunction " FIXME: We should wait until both the exit_cb _and_ the channel closed callback " have been received before OnServerExit? -function! s:_OnExit( channel, status ) abort - if !exists( 's:job' ) || ch_getjob( a:channel ) isnot s:job +function! s:_OnExit( session_id, channel, status ) abort + if !has_key( s:jobs, a:session_id ) || + \ ch_getjob( a:channel ) isnot s:jobs[ a:session_id ] call ch_log( 'Unexpected exit callback' ) return endif echom 'Channel exit with status ' . a:status redraw - if exists( 's:job' ) - unlet s:job + if has_key( s:jobs, a:session_id ) + unlet s:jobs[ a:session_id ] endif py3 _vimspector_session.OnServerExit( vim.eval( 'a:status' ) ) endfunction -function! s:_OnClose( channel ) abort - if !exists( 's:job' ) || job_getchannel( s:job ) != a:channel +function! s:_OnClose( session_id, channel ) abort + if !has_key( s:jobs, a:session_id ) || + \ ch_getjob( a:channel ) isnot s:jobs[ a:session_id ] call ch_log( 'Channel closed after exit' ) return endif @@ -65,34 +72,38 @@ function! s:_OnClose( channel ) abort redraw endfunction -function! vimspector#internal#job#StartDebugSession( config ) abort - if exists( 's:job' ) +function! vimspector#internal#job#StartDebugSession( session_id, config ) abort + if has_key( s:jobs, a:session_id ) echom 'Not starting: Job is already running' redraw return v:false endif - let s:job = job_start( a:config[ 'command' ], + let s:jobs[ a:session_id ] = job_start( a:config[ 'command' ], \ { \ 'in_mode': 'raw', \ 'out_mode': 'raw', \ 'err_mode': 'raw', - \ 'exit_cb': funcref( 's:_OnExit' ), - \ 'close_cb': funcref( 's:_OnClose' ), - \ 'out_cb': funcref( 's:_OnServerData' ), - \ 'err_cb': funcref( 's:_OnServerError' ), + \ 'exit_cb': funcref( 's:_OnExit', + \ [ a:session_id ] ), + \ 'close_cb': funcref( 's:_OnClose', + \ [ a:session_id ] ), + \ 'out_cb': funcref( 's:_OnServerData', + \ [ a:session_id ] ), + \ 'err_cb': funcref( 's:_OnServerError', + \ [ a:session_id ] ), \ 'stoponexit': 'term', \ 'env': a:config[ 'env' ], \ 'cwd': a:config[ 'cwd' ], \ } \ ) - if !exists( 's:job' ) + if !has_key( s:jobs, a:session_id ) " The job died immediately after starting and we cleaned up return v:false endif - let status = job_status( s:job ) + let status = job_status( s:jobs[ a:session_id ] ) echom 'Started job, status is: ' . status redraw @@ -104,20 +115,22 @@ function! vimspector#internal#job#StartDebugSession( config ) abort return v:true endfunction -function! vimspector#internal#job#Send( msg ) abort - if ! exists( 's:job' ) +function! vimspector#internal#job#Send( session_id, msg ) abort + if ! has_key( s:jobs, a:session_id ) echom "Can't send message: Job was not initialised correctly" redraw return 0 endif - if job_status( s:job ) !=# 'run' + let job = s:jobs[ a:session_id ] + + if job_status( job ) !=# 'run' echom "Can't send message: Job is not running" redraw return 0 endif - let ch = job_getchannel( s:job ) + let ch = job_getchannel( job ) if ch ==# 'channel fail' echom 'Channel was closed unexpectedly!' redraw @@ -128,45 +141,55 @@ function! vimspector#internal#job#Send( msg ) abort return 1 endfunction -function! vimspector#internal#job#StopDebugSession() abort - if !exists( 's:job' ) +function! vimspector#internal#job#StopDebugSession( session_id ) abort + if ! has_key( s:jobs, a:session_id ) echom "Not stopping session: Job doesn't exist" redraw return endif - if job_status( s:job ) ==# 'run' + let job = s:jobs[ a:session_id ] + + if job_status( job ) ==# 'run' echom 'Terminating job' redraw - call job_stop( s:job, 'kill' ) + call job_stop( job, 'kill' ) endif endfunction -function! vimspector#internal#job#Reset() abort - call vimspector#internal#job#StopDebugSession() +function! vimspector#internal#job#Reset( session_id ) abort + call vimspector#internal#job#StopDebugSession( a:session_id ) endfunction -function! s:_OnCommandExit( category, ch, code ) abort +function! s:_OnCommandExit( session_id, category, ch, code ) abort py3 __import__( "vimspector", \ fromlist = [ "utils" ] ).utils.OnCommandWithLogComplete( + \ vim.eval( 'a:session_id' ), \ vim.eval( 'a:category' ), \ int( vim.eval( 'a:code' ) ) ) endfunction -function! vimspector#internal#job#StartCommandWithLog( cmd, category ) abort +function! vimspector#internal#job#StartCommandWithLog( + \ session_id, + \ cmd, + \ category ) abort if ! exists( 's:commands' ) let s:commands = {} endif - if ! has_key( s:commands, a:category ) - let s:commands[ a:category ] = [] + if ! has_key( s:commands, a:session_id ) + let s:commands[ a:session_id ] = {} endif - let l:index = len( s:commands[ a:category ] ) + if ! has_key( s:commands[ a:session_id ], a:category ) + let s:commands[ a:session_id ][ a:category ] = [] + endif - let buf = '_vimspector_log_' . a:category + let l:index = len( s:commands[ a:session_id ][ a:category ] ) - call add( s:commands[ a:category ], job_start( + let buf = '_vimspector_log_' . a:session_id . '_' . a:category + + call add( s:commands[ a:session_id ][ a:category ], job_start( \ a:cmd, \ { \ 'out_io': 'buffer', @@ -175,13 +198,14 @@ function! vimspector#internal#job#StartCommandWithLog( cmd, category ) abort \ 'err_msg': 0, \ 'out_name': buf, \ 'err_name': buf, - \ 'exit_cb': funcref( 's:_OnCommandExit', [ a:category ] ), + \ 'exit_cb': funcref( 's:_OnCommandExit', + \ [ a:session_id, a:category ] ), \ 'out_modifiable': 0, \ 'err_modifiable': 0, \ 'stoponexit': 'kill' \ } ) ) - if job_status( s:commands[ a:category ][ index ] ) !=# 'run' + if job_status( s:commands[ a:session_id ][ a:category ][ index ] ) !=# 'run' echom 'Unable to start job for ' . string( a:cmd ) redraw return v:none @@ -191,19 +215,27 @@ function! vimspector#internal#job#StartCommandWithLog( cmd, category ) abort endfunction -function! vimspector#internal#job#CleanUpCommand( category ) abort +function! vimspector#internal#job#CleanUpCommand( session_id, category ) abort if ! exists( 's:commands' ) let s:commands = {} endif - if ! has_key( s:commands, a:category ) + if ! has_key( s:commands, a:session_id ) + let s:commands[ a:session_id ] = {} + endif + + if ! has_key( s:commands[ a:session_id ], a:category ) return endif - for j in s:commands[ a:category ] + for j in s:commands[ a:session_id ][ a:category ] call job_stop( j, 'kill' ) endfor - unlet s:commands[ a:category ] + unlet s:commands[ a:session_id ][ a:category ] + + if len( s:commands[ a:session_id ] ) == 0 + unlet s:commands[ a:session_id ] + endif endfunction " Boilerplate {{{ diff --git a/autoload/vimspector/internal/neochannel.vim b/autoload/vimspector/internal/neochannel.vim index f20684d..3a6fe0e 100644 --- a/autoload/vimspector/internal/neochannel.vim +++ b/autoload/vimspector/internal/neochannel.vim @@ -20,28 +20,34 @@ set cpoptions&vim " }}} +let s:channels = {} +let s:jobs = {} -function! s:_OnEvent( chan_id, data, event ) abort + +function! s:_OnEvent( session_id, chan_id, data, event ) abort if v:exiting isnot# v:null return endif - if !exists( 's:ch' ) || a:chan_id != s:ch + if !has_key( s:channels, a:session_id ) || + \ a:chan_id != s:channels[ a:session_id ] return endif if a:data == [''] echom 'Channel closed' redraw - unlet s:ch + unlet s:channels[ a:session_id ] py3 _vimspector_session.OnServerExit( 0 ) else py3 _vimspector_session.OnChannelData( '\n'.join( vim.eval( 'a:data' ) ) ) endif endfunction -function! vimspector#internal#neochannel#StartDebugSession( config ) abort - if exists( 's:ch' ) +function! vimspector#internal#neochannel#StartDebugSession( + \ session_id, + \ config ) abort + if has_key( s:channels, a:session_id ) echom 'Not starting: Channel is already running' redraw return v:false @@ -54,12 +60,12 @@ function! vimspector#internal#neochannel#StartDebugSession( config ) abort try let old_env = vimspector#internal#neoterm#PrepareEnvironment( \ a:config[ 'env' ] ) - let s:job = jobstart( a:config[ 'command' ], - \ { - \ 'cwd': a:config[ 'cwd' ], - \ 'env': a:config[ 'env' ], - \ } - \ ) + let s:jobs[ a:session_id ] = jobstart( a:config[ 'command' ], + \ { + \ 'cwd': a:config[ 'cwd' ], + \ 'env': a:config[ 'env' ], + \ } + \ ) finally call vimspector#internal#neoterm#ResetEnvironment( a:config[ 'env' ], \ old_env ) @@ -72,9 +78,10 @@ function! vimspector#internal#neochannel#StartDebugSession( config ) abort while attempt <= 10 echo 'Connecting to ' . l:addr . '... (attempt' attempt 'of 10)' try - let s:ch = sockconnect( 'tcp', - \ addr, - \ { 'on_data': funcref( 's:_OnEvent' ) } ) + let s:channels[ a:session_id ] = sockconnect( + \ 'tcp', + \ addr, + \ { 'on_data': funcref( 's:_OnEvent', [ a:session_id ] ) } ) redraw return v:true catch /connection refused/ @@ -88,30 +95,30 @@ function! vimspector#internal#neochannel#StartDebugSession( config ) abort return v:false endfunction -function! vimspector#internal#neochannel#Send( msg ) abort - if ! exists( 's:ch' ) +function! vimspector#internal#neochannel#Send( session_id, msg ) abort + if ! has_key( s:channels, a:session_id ) echom "Can't send message: Channel was not initialised correctly" redraw return 0 endif - call chansend( s:ch, a:msg ) + call chansend( s:channels[ a:session_id ], a:msg ) return 1 endfunction -function! vimspector#internal#neochannel#StopDebugSession() abort - if exists( 's:ch' ) - call chanclose( s:ch ) +function! vimspector#internal#neochannel#StopDebugSession( session_id ) abort + if has_key( s:channels, a:session_id ) + call chanclose( s:channels[ a:session_id ] ) " It doesn't look like we get a callback after chanclos. Who knows if we " will subsequently receive data callbacks. - call s:_OnEvent( s:ch, [ '' ], 'data' ) + call s:_OnEvent( a:session_id, s:channels[ a:session_id ], [ '' ], 'data' ) endif - if exists( 's:job' ) - if vimspector#internal#neojob#JobIsRunning( s:job ) - call jobstop( s:job ) + if has_key( s:jobs, a:session_id ) + if vimspector#internal#neojob#JobIsRunning( s:jobs[ a:session_id ] ) + call jobstop( s:jobs[ a:session_id ] ) endif - unlet s:job + unlet s:jobs[ a:session_id ] endif endfunction diff --git a/autoload/vimspector/internal/neojob.vim b/autoload/vimspector/internal/neojob.vim index 0cefc63..73a7984 100644 --- a/autoload/vimspector/internal/neojob.vim +++ b/autoload/vimspector/internal/neojob.vim @@ -19,14 +19,17 @@ let s:save_cpo = &cpoptions set cpoptions&vim " }}} +let s:jobs = {} +let s:commands = {} -function! s:_OnEvent( chan_id, data, event ) abort + +function! s:_OnEvent( session_id, chan_id, data, event ) abort if v:exiting isnot# v:null return endif - if !exists( 's:job' ) || a:chan_id != s:job + if !has_key( s:jobs, a:session_id ) || a:chan_id != s:jobs[ a:session_id ] return endif @@ -38,13 +41,15 @@ function! s:_OnEvent( chan_id, data, event ) abort elseif a:event ==# 'exit' echom 'Channel exit with status ' . a:data redraw - unlet s:job + unlet s:jobs[ a:session_id ] py3 _vimspector_session.OnServerExit( vim.eval( 'a:data' ) ) endif endfunction -function! vimspector#internal#neojob#StartDebugSession( config ) abort - if exists( 's:job' ) +function! vimspector#internal#neojob#StartDebugSession( + \ session_id, + \ config ) abort + if has_key( s:jobs, a:session_id ) echom 'Not starging: Job is already running' redraw return v:false @@ -57,11 +62,14 @@ function! vimspector#internal#neojob#StartDebugSession( config ) abort try let old_env = vimspector#internal#neoterm#PrepareEnvironment( \ a:config[ 'env' ] ) - let s:job = jobstart( a:config[ 'command' ], + let s:jobs[ a:session_id ] = jobstart( a:config[ 'command' ], \ { - \ 'on_stdout': funcref( 's:_OnEvent' ), - \ 'on_stderr': funcref( 's:_OnEvent' ), - \ 'on_exit': funcref( 's:_OnEvent' ), + \ 'on_stdout': funcref( 's:_OnEvent', + \ [ a:session_id ] ), + \ 'on_stderr': funcref( 's:_OnEvent', + \ [ a:session_id ] ), + \ 'on_exit': funcref( 's:_OnEvent', + \ [ a:session_id ] ), \ 'cwd': a:config[ 'cwd' ], \ 'env': a:config[ 'env' ], \ } @@ -78,40 +86,40 @@ function! vimspector#internal#neojob#JobIsRunning( job ) abort return jobwait( [ a:job ], 0 )[ 0 ] == -1 endfunction -function! vimspector#internal#neojob#Send( msg ) abort - if ! exists( 's:job' ) +function! vimspector#internal#neojob#Send( session_id, msg ) abort + if ! has_key( s:jobs, a:session_id ) echom "Can't send message: Job was not initialised correctly" redraw return 0 endif - if !vimspector#internal#neojob#JobIsRunning( s:job ) + if !vimspector#internal#neojob#JobIsRunning( s:jobs[ a:session_id ] ) echom "Can't send message: Job is not running" redraw return 0 endif - call chansend( s:job, a:msg ) + call chansend( s:jobs[ a:session_id ], a:msg ) return 1 endfunction -function! vimspector#internal#neojob#StopDebugSession() abort - if !exists( 's:job' ) +function! vimspector#internal#neojob#StopDebugSession( session_id ) abort + if !has_key( s:jobs, a:session_id ) return endif - if vimspector#internal#neojob#JobIsRunning( s:job ) + if vimspector#internal#neojob#JobIsRunning( s:jobs[ a:session_id ] ) echom 'Terminating job' redraw - call jobstop( s:job ) + call jobstop( s:jobs[ a:session_id ] ) endif endfunction -function! vimspector#internal#neojob#Reset() abort - call vimspector#internal#neojob#StopDebugSession() +function! vimspector#internal#neojob#Reset( session_id ) abort + call vimspector#internal#neojob#StopDebugSession( a:session_id ) endfunction -function! s:_OnCommandEvent( category, id, data, event ) abort +function! s:_OnCommandEvent( session_id, category, id, data, event ) abort if v:exiting isnot# v:null return endif @@ -121,18 +129,22 @@ function! s:_OnCommandEvent( category, id, data, event ) abort return endif - if !has_key( s:commands, a:category ) + if ! has_key( s:commands, a:session_id ) return endif - if !has_key( s:commands[ a:category ], a:id ) + if !has_key( s:commands[ a:session_id ], a:category ) + return + endif + + if !has_key( s:commands[ a:session_id ][ a:category ], a:id ) return endif if a:event ==# 'stdout' - let buffer = s:commands[ a:category ][ a:id ].stdout + let buffer = s:commands[ a:session_id ][ a:category ][ a:id ].stdout elseif a:event ==# 'stderr' - let buffer = s:commands[ a:category ][ a:id ].stderr + let buffer = s:commands[ a:session_id ][ a:category ][ a:id ].stderr endif try @@ -173,6 +185,7 @@ function! s:_OnCommandEvent( category, id, data, event ) abort elseif a:event ==# 'exit' py3 __import__( "vimspector", \ fromlist = [ "utils" ] ).utils.OnCommandWithLogComplete( + \ vim.eval( 'a:session_id' ), \ vim.eval( 'a:category' ), \ int( vim.eval( 'a:data' ) ) ) endif @@ -198,11 +211,16 @@ function! s:MakeBufferWritable( buffer ) abort endfunction -let s:commands = {} +function! vimspector#internal#neojob#StartCommandWithLog( + \ session_id, + \ cmd, + \ category ) abort + if ! has_key( s:commands, a:session_id ) + let s:commands[ a:session_id ] = {} + endif -function! vimspector#internal#neojob#StartCommandWithLog( cmd, category ) abort - if ! has_key( s:commands, a:category ) - let s:commands[ a:category ] = {} + if ! has_key( s:commands[ a:session_id ], a:category ) + let s:commands[ a:session_id ][ a:category ] = {} endif let buf = bufnr( '_vimspector_log_' . a:category, v:true ) @@ -215,14 +233,14 @@ function! vimspector#internal#neojob#StartCommandWithLog( cmd, category ) abort let id = jobstart(a:cmd, \ { \ 'on_stdout': funcref( 's:_OnCommandEvent', - \ [ a:category ] ), + \ [ a:session_id, a:category ] ), \ 'on_stderr': funcref( 's:_OnCommandEvent', - \ [ a:category ] ), + \ [ a:session_id, a:category ] ), \ 'on_exit': funcref( 's:_OnCommandEvent', - \ [ a:category ] ), + \ [ a:session_id, a:category ] ), \ } ) - let s:commands[ a:category ][ id ] = { + let s:commands[ a:session_id ][ a:category ][ id ] = { \ 'stdout': buf, \ 'stderr': buf \ } @@ -230,19 +248,25 @@ function! vimspector#internal#neojob#StartCommandWithLog( cmd, category ) abort return buf endfunction -function! vimspector#internal#neojob#CleanUpCommand( category ) abort - if ! has_key( s:commands, a:category ) +function! vimspector#internal#neojob#CleanUpCommand( + \ session_id, + \ category ) abort + if ! has_key( s:commands, a:session_id ) return endif - for id in keys( s:commands[ a:category ] ) + if ! has_key( s:commands[ a:session_id ], a:category ) + return + endif + + for id in keys( s:commands[ a:session_id ][ a:category ] ) let id = str2nr( id ) if jobwait( [ id ], 0 )[ 0 ] == -1 call jobstop( id ) endif call jobwait( [ id ], -1 ) endfor - unlet! s:commands[ a:category ] + unlet! s:commands[ a:session_id ][ a:category ] endfunction " Boilerplate {{{ diff --git a/python3/vimspector/debug_adapter_connection.py b/python3/vimspector/debug_adapter_connection.py index df2ef13..4b7016b 100644 --- a/python3/vimspector/debug_adapter_connection.py +++ b/python3/vimspector/debug_adapter_connection.py @@ -53,8 +53,11 @@ class DebugAdapterConnection( object ): # TODO/FIXME: This is so messy expiry_id = vim.eval( - 'timer_start( {}, "vimspector#internal#channel#Timeout" )'.format( - timeout ) ) + 'timer_start( {}, ' + ' function( "vimspector#internal#channel#Timeout", ' + ' [ {} ] ) )'.format( + timeout, + self._handler.session_id ) ) request = PendingRequest( msg, handler, diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index 2f132f9..e1af7a7 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -42,9 +42,25 @@ VIMSPECTOR_HOME = utils.GetVimspectorBase() # cache of what the user entered for any option we ask them USER_CHOICES = {} +NEXT_SESSION_ID = 0 +SESSIONS = {} + + +def PushSession( session ): + global NEXT_SESSION_ID + this_id = NEXT_SESSION_ID + NEXT_SESSION_ID = NEXT_SESSION_ID + 1 + SESSIONS[ this_id ] = session + return this_id + + +def PopSession( session ): + SESSIONS.pop( session.session_id, None ) + class DebugSession( object ): def __init__( self, api_prefix ): + self.session_id = PushSession( self ) self._logger = logging.getLogger( __name__ ) utils.SetUpLogging( self._logger ) @@ -73,6 +89,11 @@ class DebugSession( object ): self._ResetServerState() + + def __del__( self ): + PopSession( self ) + + def _ResetServerState( self ): self._connection = None self._init_complete = False @@ -887,8 +908,10 @@ class DebugSession( object ): vim.vars[ '_vimspector_adapter_spec' ] = self._adapter if not vim.eval( "vimspector#internal#{}#StartDebugSession( " + " {}," " g:_vimspector_adapter_spec " - ")".format( self._connection_type ) ): + ")".format( self._connection_type, + self.session_id ) ): self._logger.error( "Unable to start debug server" ) self._splash_screen = utils.DisplaySplash( self._api_prefix, self._splash_screen, @@ -911,6 +934,7 @@ class DebugSession( object ): handlers, lambda msg: utils.Call( "vimspector#internal#{}#Send".format( self._connection_type ), + self.session_id, msg ) ) self._logger.info( 'Debug Adapter Started' ) @@ -933,8 +957,9 @@ class DebugSession( object ): assert not self._run_on_server_exit self._run_on_server_exit = callback - vim.eval( 'vimspector#internal#{}#StopDebugSession()'.format( - self._connection_type ) ) + vim.eval( 'vimspector#internal#{}#StopDebugSession( {} )'.format( + self._connection_type, + self.session_id ) ) self._connection.DoRequest( handler, { 'command': 'disconnect', diff --git a/python3/vimspector/output.py b/python3/vimspector/output.py index c453417..3322b0d 100644 --- a/python3/vimspector/output.py +++ b/python3/vimspector/output.py @@ -63,6 +63,8 @@ class OutputView( object ): self._buffers = {} self._api_prefix = api_prefix VIEWS.add( self ) + # FIXME: hack? + self._session_id = hash( self ) def Print( self, categroy, text ): self._Print( 'server', text.splitlines() ) @@ -105,7 +107,7 @@ class OutputView( object ): def Clear( self ): for category, tab_buffer in self._buffers.items(): if tab_buffer.is_job: - utils.CleanUpCommand( category, self._api_prefix ) + utils.CleanUpCommand( self._session_id, category, self._api_prefix ) utils.CleanUpHiddenBuffer( tab_buffer.buf ) # FIXME: nunmenu the WinBar ? @@ -174,6 +176,7 @@ class OutputView( object ): if cmd is not None: out = utils.SetUpCommandBuffer( + self._session_id, # TODO: not really a session id cmd, category, self._api_prefix, diff --git a/python3/vimspector/utils.py b/python3/vimspector/utils.py index 5f836fc..ef0a077 100644 --- a/python3/vimspector/utils.py +++ b/python3/vimspector/utils.py @@ -87,16 +87,21 @@ def OpenFileInCurrentWindow( file_name ): COMMAND_HANDLERS = {} -def OnCommandWithLogComplete( name, exit_code ): - cb = COMMAND_HANDLERS.get( name ) +def OnCommandWithLogComplete( session_id, name, exit_code ): + cb = COMMAND_HANDLERS.get( str( session_id ) + '.' + name ) if cb: cb( exit_code ) -def SetUpCommandBuffer( cmd, name, api_prefix, completion_handler = None ): - COMMAND_HANDLERS[ name ] = completion_handler +def SetUpCommandBuffer( session_id, + cmd, + name, + api_prefix, + completion_handler = None ): + COMMAND_HANDLERS[ str( session_id ) + '.' + name ] = completion_handler buf = Call( f'vimspector#internal#{api_prefix}job#StartCommandWithLog', + session_id, cmd, name ) @@ -110,10 +115,12 @@ def SetUpCommandBuffer( cmd, name, api_prefix, completion_handler = None ): return vim.buffers[ int( buf ) ] -def CleanUpCommand( name, api_prefix ): - return vim.eval( 'vimspector#internal#{}job#CleanUpCommand( "{}" )'.format( - api_prefix, - name ) ) +def CleanUpCommand( session_id, name, api_prefix ): + return vim.eval( + 'vimspector#internal#{}job#CleanUpCommand( {}, "{}" )'.format( + api_prefix, + session_id, + name ) ) def CleanUpHiddenBuffer( buf ): diff --git a/python3/vimspector/variables.py b/python3/vimspector/variables.py index 8dcb493..5cdd712 100644 --- a/python3/vimspector/variables.py +++ b/python3/vimspector/variables.py @@ -224,9 +224,12 @@ class VariablesView( object ): 'balloonexpr': vim.options[ 'balloonexpr' ], 'balloondelay': vim.options[ 'balloondelay' ], } + # TODO: How can we make this work. I think we can set ballooneval as a + # buffer-local or maybe window-local variable ? We could pass session_id + # to the expression here, but still how would it work with 2 concurrent + # sessions? vim.options[ 'balloonexpr' ] = ( "vimspector#internal#" "balloon#HoverTooltip()" ) - vim.options[ 'balloondelay' ] = 250 if has_balloon: diff --git a/support/test/python/simple_python/print_env.py b/support/test/python/simple_python/print_env.py index 4b88f2d..17b6861 100644 --- a/support/test/python/simple_python/print_env.py +++ b/support/test/python/simple_python/print_env.py @@ -6,8 +6,9 @@ import os def Main(): print( os.environ.get( 'Something', 'ERROR' ) ) print( os.environ.get( 'SomethingElse', 'ERROR' ) ) + print( os.environ.get( 'PATH', 'ERROR' ) ) - for k, v in os.environ: + for k, v in os.environ.items(): print( f'{ k } = "{ v }"' ) diff --git a/tests/language_python.test.vim b/tests/language_python.test.vim index cc49adb..37dcc16 100644 --- a/tests/language_python.test.vim +++ b/tests/language_python.test.vim @@ -107,3 +107,46 @@ function! Test_Python_Remote_Attach() lcd - %bwipeout! endfunction + +function! SetUp_Test_Python_Remote_Attach_With_Run() + let g:vimspector_enable_mappings = 'HUMAN' +endfunction + +function! Test_Python_Remote_Attach_With_Run() + lcd ../support/test/python/simple_python + let fn='main.py' + exe 'edit ' . fn + + call setpos( '.', [ 0, 6, 1 ] ) + + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 ) + call vimspector#test#signs#AssertSignGroupEmptyAtLine( 'VimspectorBP', 6 ) + + " Add the breakpoint + call feedkeys( "\", 'xt' ) + call vimspector#test#signs#AssertSignGroupSingletonAtLine( 'VimspectorBP', + \ 6, + \ 'vimspectorBP', + \ 9 ) + + call setpos( '.', [ 0, 1, 1 ] ) + + " Here we go. Start Debugging (note will wait up to 10s for the script to do + " its virtualenv thing) + call vimspector#LaunchWithSettings( { + \ 'configuration': 'attach-run', + \ } ) + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 ) + + " Step + call feedkeys( "\", 'xt' ) + + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 7, 1 ) + call WaitForAssert( {-> + \ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 7 ) + \ } ) + + call vimspector#test#setup#Reset() + lcd - + %bwipeout! +endfunction From 099431ba556e7bf73e97886a2b9a14a52c663a96 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sat, 5 Dec 2020 22:24:54 +0000 Subject: [PATCH 02/47] Start to create session manager Kind of works, but there's still a single global _vimspector_session --- autoload/vimspector/internal/state.vim | 8 ++-- .../vimspector/debug_adapter_connection.py | 6 +-- python3/vimspector/debug_session.py | 28 +++-------- python3/vimspector/session_manager.py | 46 +++++++++++++++++++ 4 files changed, 61 insertions(+), 27 deletions(-) create mode 100644 python3/vimspector/session_manager.py diff --git a/autoload/vimspector/internal/state.vim b/autoload/vimspector/internal/state.vim index f1e690a..e628eaa 100644 --- a/autoload/vimspector/internal/state.vim +++ b/autoload/vimspector/internal/state.vim @@ -27,10 +27,12 @@ endif function! vimspector#internal#state#Reset() abort try py3 import vim - py3 _vimspector_session = __import__( + py3 _vimspector_session_manager = __import__( \ "vimspector", - \ fromlist=[ "debug_session" ] ).debug_session.DebugSession( - \ vim.eval( 's:prefix' ) ) + \ fromlist=[ "session_manager" ] ).session_manager.SessionManager() + + py3 _vimspector_session = _vimspector_session_manager = + \ _vimspector_session_manager.NewSession( vim.eval( 's:prefix' ) ) catch /.*/ echohl WarningMsg echom 'Exception while loading vimspector:' v:exception diff --git a/python3/vimspector/debug_adapter_connection.py b/python3/vimspector/debug_adapter_connection.py index 4b7016b..d4cc239 100644 --- a/python3/vimspector/debug_adapter_connection.py +++ b/python3/vimspector/debug_adapter_connection.py @@ -29,7 +29,7 @@ class PendingRequest( object ): class DebugAdapterConnection( object ): - def __init__( self, handlers, send_func ): + def __init__( self, handlers, session_id, send_func ): self._logger = logging.getLogger( __name__ ) utils.SetUpLogging( self._logger ) @@ -37,6 +37,7 @@ class DebugAdapterConnection( object ): self._SetState( 'READ_HEADER' ) self._buffer = bytes() self._handlers = handlers + self._session_id = session_id self._next_message_id = 0 self._outstanding_requests = {} @@ -51,13 +52,12 @@ class DebugAdapterConnection( object ): msg[ 'seq' ] = this_id msg[ 'type' ] = 'request' - # TODO/FIXME: This is so messy expiry_id = vim.eval( 'timer_start( {}, ' ' function( "vimspector#internal#channel#Timeout", ' ' [ {} ] ) )'.format( timeout, - self._handler.session_id ) ) + self._session_id ) ) request = PendingRequest( msg, handler, diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index e1af7a7..7b1916d 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -42,25 +42,10 @@ VIMSPECTOR_HOME = utils.GetVimspectorBase() # cache of what the user entered for any option we ask them USER_CHOICES = {} -NEXT_SESSION_ID = 0 -SESSIONS = {} - - -def PushSession( session ): - global NEXT_SESSION_ID - this_id = NEXT_SESSION_ID - NEXT_SESSION_ID = NEXT_SESSION_ID + 1 - SESSIONS[ this_id ] = session - return this_id - - -def PopSession( session ): - SESSIONS.pop( session.session_id, None ) - - class DebugSession( object ): - def __init__( self, api_prefix ): - self.session_id = PushSession( self ) + def __init__( self, session_id, session_manager, api_prefix ): + self.session_id = session_id + self.manager = session_manager self._logger = logging.getLogger( __name__ ) utils.SetUpLogging( self._logger ) @@ -91,7 +76,7 @@ class DebugSession( object ): def __del__( self ): - PopSession( self ) + self.manager.DestroySession( self ) def _ResetServerState( self ): @@ -931,8 +916,9 @@ class DebugSession( object ): handlers = [ self ] self._connection = debug_adapter_connection.DebugAdapterConnection( - handlers, - lambda msg: utils.Call( + handlers = handlers, + session_id = self.session_id, + send_func = lambda msg: utils.Call( "vimspector#internal#{}#Send".format( self._connection_type ), self.session_id, msg ) ) diff --git a/python3/vimspector/session_manager.py b/python3/vimspector/session_manager.py new file mode 100644 index 0000000..25a6f85 --- /dev/null +++ b/python3/vimspector/session_manager.py @@ -0,0 +1,46 @@ +# vimspector - A multi-language debugging system for Vim +# Copyright 2020 Ben Jackson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from vimspector.debug_session import DebugSession + + +class SessionManager: + next_session_id = 0 + sessions = {} + current_session = None + + + def NewSession( self, *args, **kwargs ): + session_id = self.next_session_id + self.next_session_id += 1 + session = DebugSession( session_id, self, *args, **kwargs ) + self.sessions[ session_id ] = session + + if self.current_session is None: + self.current_session = session.session_id + + return session + + + def DestroySession( self, session: DebugSession ): + del self.sessions[ session.session_id ] + + + def GetSession( self, session_id ): + return self.sessions.get( session_id ) + + + def CurrentSession( self ): + return self.GetSession( self.current_session ) From 0cdab6be4ef4fd6c2c54db2d80be77d549c3b8f5 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 25 Mar 2021 22:08:31 +0000 Subject: [PATCH 03/47] React to the debugpyAttach event and try and start a new session; this gets tripped up by the _vimspector.Variables (etc) buffers already existing. Probably need to add the sesssion ID to the buffer name --- autoload/vimspector/internal/state.vim | 8 ++-- python3/vimspector/custom/python.py | 46 +++++++++++++++++++ python3/vimspector/debug_session.py | 7 +-- python3/vimspector/gadgets.py | 3 +- python3/vimspector/session_manager.py | 12 ++++- .../python/multiprocessing/.vimspector.json | 24 ++++++++++ .../multiprocessing/multiprocessing_test.py | 27 +++++++++++ 7 files changed, 117 insertions(+), 10 deletions(-) create mode 100644 python3/vimspector/custom/python.py create mode 100644 support/test/python/multiprocessing/.vimspector.json create mode 100644 support/test/python/multiprocessing/multiprocessing_test.py diff --git a/autoload/vimspector/internal/state.vim b/autoload/vimspector/internal/state.vim index e628eaa..1c0458f 100644 --- a/autoload/vimspector/internal/state.vim +++ b/autoload/vimspector/internal/state.vim @@ -27,12 +27,10 @@ endif function! vimspector#internal#state#Reset() abort try py3 import vim - py3 _vimspector_session_manager = __import__( + py3 _vimspector_session = __import__( \ "vimspector", - \ fromlist=[ "session_manager" ] ).session_manager.SessionManager() - - py3 _vimspector_session = _vimspector_session_manager = - \ _vimspector_session_manager.NewSession( vim.eval( 's:prefix' ) ) + \ fromlist=[ "session_manager" ] ).session_manager.Get().NewSession( + \ vim.eval( 's:prefix' ) ) catch /.*/ echohl WarningMsg echom 'Exception while loading vimspector:' v:exception diff --git a/python3/vimspector/custom/python.py b/python3/vimspector/custom/python.py new file mode 100644 index 0000000..8f6f578 --- /dev/null +++ b/python3/vimspector/custom/python.py @@ -0,0 +1,46 @@ +# vimspector - A multi-language debugging system for Vim +# Copyright 2021 Ben Jackson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from vimspector.debug_session import DebugSession +from vimspector import session_manager + +from typing import Sequence + + +class Debugpy( object ): + parent: DebugSession + sessions: Sequence[ DebugSession ] + + def __init__( self, debug_session: DebugSession ): + self.parent = debug_session + + + def OnEvent_debugpyAttach( self, message ): + # Debugpy sends us the contents of a launch request that we should use. We + # probaly just jave to guess the rest + launch_argyments = message[ 'body' ] + session = session_manager.Get().NewSession( self.parent._api_prefix ) + + # Inject the launch config (HACK!). This will actually mean that the + # configuration passed below is ignored. + session._launch_config = launch_argyments + + # FIXME: We probably do need to add a StartWithLauncArguments and somehow + # tell the new session that it shoud not support "Restart" requests ? + # + # In fact, what even would Reset do... ? + session._StartWithConfiguration( self.parent._configuration, + self.parent._adapter ) + diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index 7b1916d..f80c217 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -1190,9 +1190,10 @@ class DebugSession( object ): self._on_init_complete_handlers = [] self._logger.debug( "LAUNCH!" ) - self._launch_config = {} - self._launch_config.update( self._adapter.get( 'configuration', {} ) ) - self._launch_config.update( self._configuration[ 'configuration' ] ) + if self._launch_config is None: + self._launch_config = {} + self._launch_config.update( self._adapter.get( 'configuration', {} ) ) + self._launch_config.update( self._configuration[ 'configuration' ] ) request = self._configuration.get( 'remote-request', diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 528f60c..5524899 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -136,7 +136,8 @@ GADGETS = { # doesn't support the custom messages) # https://github.com/puremourning/vimspector/issues/141 "subProcess": False, - } + }, + 'custom_handler': 'vimspector.custom.python.Debugpy' } }, }, diff --git a/python3/vimspector/session_manager.py b/python3/vimspector/session_manager.py index 25a6f85..e48f03d 100644 --- a/python3/vimspector/session_manager.py +++ b/python3/vimspector/session_manager.py @@ -15,6 +15,9 @@ from vimspector.debug_session import DebugSession +# Singleton +_session_manager = None + class SessionManager: next_session_id = 0 @@ -41,6 +44,13 @@ class SessionManager: def GetSession( self, session_id ): return self.sessions.get( session_id ) - def CurrentSession( self ): return self.GetSession( self.current_session ) + + +def Get(): + global _session_manager + if _session_manager is None: + _session_manager = SessionManager() + + return _session_manager diff --git a/support/test/python/multiprocessing/.vimspector.json b/support/test/python/multiprocessing/.vimspector.json new file mode 100644 index 0000000..66272e3 --- /dev/null +++ b/support/test/python/multiprocessing/.vimspector.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json", + "configurations": { + "run": { + "adapter": "debugpy", + "configuration": { + "request": "launch", + "type": "python", + "cwd": "${workspaceRoot}", + "program": "${file}", + "stopOnEntry": false, + "console": "integratedTerminal", + "subProcess": true + }, + "breakpoints": { + "exception": { + "raised": "N", + "uncaught": "Y", + "userUnhandled": "" + } + } + } + } +} diff --git a/support/test/python/multiprocessing/multiprocessing_test.py b/support/test/python/multiprocessing/multiprocessing_test.py new file mode 100644 index 0000000..1a4d0a7 --- /dev/null +++ b/support/test/python/multiprocessing/multiprocessing_test.py @@ -0,0 +1,27 @@ +import time +import multiprocessing as mp + + +def First(): + for _ in range( 100 ): + print( "in first" ) + time.sleep( 0.1 ) + + +def Second(): + for _ in range( 100 ): + print( "in second" ) + time.sleep( 0.1 ) + + +print( "main" ) +p1 = mp.Process( target=First ) +p2 = mp.Process( target=Second ) + +p1.start() +p2.start() + +p1.join() +p2.join() + +print( "Done" ) From 0d9e7835a85d6b0e53faeac982d1a4599aaf6fd6 Mon Sep 17 00:00:00 2001 From: puh <-> Date: Mon, 29 Mar 2021 23:11:26 +0300 Subject: [PATCH 04/47] Update CodeLLDB --- python3/vimspector/gadgets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 528f60c..d2c280b 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -453,12 +453,12 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.5.3', + 'version': 'v1.6.1', }, 'macos': { 'file_name': 'codelldb-x86_64-darwin.vsix', 'checksum': - '7505bc1cdfcfd1cb981e2996aec62d63577440709bac31dcadb41a3b4b44631a', + 'b1c998e7421beea9f3ba21aa5706210bb2249eba93c99b809247ee831075262f', 'make_executable': [ 'adapter/codelldb', 'lldb/bin/debugserver', @@ -469,7 +469,7 @@ GADGETS = { 'linux': { 'file_name': 'codelldb-x86_64-linux.vsix', 'checksum': - 'ce7efc3e94d775368e5942a02bf5c326b6809a0b4c389f79ffa6a8f6f6b72139', + 'f2a36cb6971fd95a467cf1a7620e160914e8f11bf82929932ee0aa5afbf6ae6a', 'make_executable': [ 'adapter/codelldb', 'lldb/bin/lldb', @@ -480,7 +480,7 @@ GADGETS = { 'windows': { 'file_name': 'codelldb-x86_64-windows.vsix', 'checksum': - '', + 'ca6a6525bf7719dc95265dc630b3cc817a8c0393b756fd242b710805ffdfb940', 'make_executable': [] }, 'adapters': { From 2f05a7f66abf9a836287f0edc09262700137c47b Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 31 Mar 2021 21:55:33 +0100 Subject: [PATCH 05/47] WIP: Make multi-session debugging sort of work This passes the session id around everywhere and ensures that things like buffer names are all unique. We now have the _vimspector_session update to point to the active (or last accessed tab). This feels fairly natural and mostly seems to work. NOTE: in vscode there is no "multiple tabs" - they actually add the subprocesses to the stack trace somehow and when you click on a frame in that it switches to the session for that process. Each process PC is visible in the editor. It's kind of confusing. Things still broken: - vimspector_session_windows - breakpoints need to be project-wide - PC display (how to show "all" PCs, or just show the current one for the current tab ?) - it would be nice for the tterminal buffers to be visible on all tabs. not sure how to do that. --- autoload/vimspector/internal/channel.vim | 14 ++--- autoload/vimspector/internal/job.vim | 9 ++- autoload/vimspector/internal/state.vim | 37 +++++++++++-- plugin/vimspector.vim | 1 + python3/vimspector/breakpoints.py | 25 +++++++-- python3/vimspector/code.py | 18 +++--- python3/vimspector/custom/python.py | 55 +++++++++++++++---- .../vimspector/debug_adapter_connection.py | 4 +- python3/vimspector/debug_session.py | 46 ++++++++++++---- python3/vimspector/output.py | 20 ++++--- python3/vimspector/session_manager.py | 14 +++-- python3/vimspector/stack_trace.py | 14 +++-- python3/vimspector/utils.py | 32 ++++++++++- python3/vimspector/variables.py | 25 ++++++--- .../python/multiprocessing/.vimspector.json | 21 ++++++- .../multiprocessing/multiprocessing_test.py | 25 +++------ 16 files changed, 261 insertions(+), 99 deletions(-) diff --git a/autoload/vimspector/internal/channel.vim b/autoload/vimspector/internal/channel.vim index fb97b19..60eddf4 100644 --- a/autoload/vimspector/internal/channel.vim +++ b/autoload/vimspector/internal/channel.vim @@ -28,9 +28,8 @@ function! s:_OnServerData( session_id, channel, data ) abort return endif - py3 << EOF -_vimspector_session.OnChannelData( vim.eval( 'a:data' ) ) -EOF + py3 _VimspectorSession( vim.eval( 'a:session_id' ) ).OnChannelData( + \ vim.eval( 'a:data' ) ) endfunction function! s:_OnClose( session_id, channel ) abort @@ -42,7 +41,7 @@ function! s:_OnClose( session_id, channel ) abort echom 'Channel closed' redraw unlet s:channels[ a:session_id ] - py3 _vimspector_session.OnServerExit( 0 ) + py3 _VimspectorSession( vim.eval( 'a:session_id' ) ).OnServerExit( 0 ) endfunction function! vimspector#internal#channel#StartDebugSession( @@ -99,9 +98,8 @@ function! vimspector#internal#channel#Send( session_id, msg ) abort endfunction function! vimspector#internal#channel#Timeout( session_id, id ) abort - py3 << EOF -_vimspector_session.OnRequestTimeout( vim.eval( 'a:id' ) ) -EOF + py3 _VimspectorSession( vim.eval( 'a:session_id' ) ).OnRequestTimeout( + \ vim.eval( 'a:id' ) ) endfunction function! s:_ChannelExists( session_id ) abort @@ -149,7 +147,7 @@ function! vimspector#internal#channel#StopDebugSession( session_id ) abort call s:_OnServerData( s:channels[ a:session_id ], data ) endwhile if has_key( s:channels, a:session_id ) - call s:_OnClose( s:channels[ a:session_id ] ) + call s:_OnClose( a:session_id, s:channels[ a:session_id ] ) endif endfunction diff --git a/autoload/vimspector/internal/job.vim b/autoload/vimspector/internal/job.vim index 39dca29..413abb8 100644 --- a/autoload/vimspector/internal/job.vim +++ b/autoload/vimspector/internal/job.vim @@ -29,7 +29,8 @@ function! s:_OnServerData( session_id, channel, data ) abort return endif - py3 _vimspector_session.OnChannelData( vim.eval( 'a:data' ) ) + py3 _VimspectorSession( vim.eval( 'a:session_id' ) ).OnChannelData( + \ vim.eval( 'a:data' ) ) endfunction function! s:_OnServerError( session_id, channel, data ) abort @@ -39,7 +40,8 @@ function! s:_OnServerError( session_id, channel, data ) abort return endif - py3 _vimspector_session.OnServerStderr( vim.eval( 'a:data' ) ) + py3 _VimspectorSession( vim.eval( 'a:session_id' ) ).OnServerStderr( + \ vim.eval( 'a:data' ) ) endfunction @@ -58,7 +60,8 @@ function! s:_OnExit( session_id, channel, status ) abort if has_key( s:jobs, a:session_id ) unlet s:jobs[ a:session_id ] endif - py3 _vimspector_session.OnServerExit( vim.eval( 'a:status' ) ) + py3 _VimspectorSession( vim.eval( 'a:session_id' ) ).OnServerExit( + \ vim.eval( 'a:status' ) ) endfunction function! s:_OnClose( session_id, channel ) abort diff --git a/autoload/vimspector/internal/state.vim b/autoload/vimspector/internal/state.vim index 1c0458f..59966dd 100644 --- a/autoload/vimspector/internal/state.vim +++ b/autoload/vimspector/internal/state.vim @@ -26,11 +26,22 @@ endif function! vimspector#internal#state#Reset() abort try - py3 import vim - py3 _vimspector_session = __import__( - \ "vimspector", - \ fromlist=[ "session_manager" ] ).session_manager.Get().NewSession( - \ vim.eval( 's:prefix' ) ) + py3 <' ) ) + autocmd TabEnter * call vimspector#internal#state#OnTabEnter() augroup END " boilerplate {{{ diff --git a/python3/vimspector/breakpoints.py b/python3/vimspector/breakpoints.py index 7aa50ce..a33c468 100644 --- a/python3/vimspector/breakpoints.py +++ b/python3/vimspector/breakpoints.py @@ -34,13 +34,24 @@ class ServerBreakpointHandler( object ): pass +# FIXME: THis really should be project scope and not associated with a debug +# session. Breakpoints set by the user should be independent and breakpoints for +# the current active session should be associated with the session when they are +# in use. +# +# Questions include: +# 1. what happens if we set/chnage a breakpiont in session #2 while session #1 +# is active ? Maybe we re-send the breakpoints to _all_ active sessions? +# +# More... class ProjectBreakpoints( object ): - def __init__( self ): + def __init__( self, session_id ): self._connection = None - self._logger = logging.getLogger( __name__ ) - utils.SetUpLogging( self._logger ) + self._logger = logging.getLogger( __name__ + '.' + str( session_id ) ) + utils.SetUpLogging( self._logger, session_id ) - # These are the user-entered breakpoints. + # These are the user-entered breakpoints. NOTE: if updating this, also + # update Copy() self._line_breakpoints = defaultdict( list ) self._func_breakpoints = [] self._exception_breakpoints = None @@ -91,6 +102,12 @@ class ProjectBreakpoints( object ): # FIXME: If the adapter type changes, we should probably forget this ? + def Copy( self, other: 'ProjectBreakpoints' ): + self._line_breakpoints = dict( other._line_breakpoints ) + self._func_breakpoints = list( other._func_breakpoints ) + if other._exception_breakpoints is not None: + self._exception_breakpoints = dict( other._exception_breakpoints ) + def BreakpointsAsQuickFix( self ): # FIXME: Handling of breakpoints is a mess, split between _codeView and this # object. This makes no sense and should be centralised so that we don't diff --git a/python3/vimspector/code.py b/python3/vimspector/code.py index 98aeca5..ffcf912 100644 --- a/python3/vimspector/code.py +++ b/python3/vimspector/code.py @@ -20,20 +20,20 @@ from collections import defaultdict from vimspector import utils, terminal, signs +NEXT_SIGN_ID = 1 + class CodeView( object ): - def __init__( self, window, api_prefix ): + def __init__( self, session_id, window, api_prefix ): self._window = window self._api_prefix = api_prefix self._terminal = None self.current_syntax = None - self._logger = logging.getLogger( __name__ ) + self._logger = logging.getLogger( __name__ + '.' + str( session_id ) ) utils.SetUpLogging( self._logger ) - # FIXME: This ID is by group, so should be module scope - self._next_sign_id = 1 self._breakpoints = defaultdict( list ) self._signs = { 'vimspectorPC': None, @@ -92,8 +92,9 @@ class CodeView( object ): self._UndisplayPC( clear_pc = False ) # FIXME: Do we relly need to keep using up IDs ? - self._signs[ 'vimspectorPC' ] = self._next_sign_id - self._next_sign_id += 1 + global NEXT_SIGN_ID + self._signs[ 'vimspectorPC' ] = NEXT_SIGN_ID + NEXT_SIGN_ID += 1 sign = 'vimspectorPC' # If there's also a breakpoint on this line, use vimspectorPCBP @@ -247,8 +248,9 @@ class CodeView( object ): if 'line' not in breakpoint: continue - sign_id = self._next_sign_id - self._next_sign_id += 1 + global NEXT_SIGN_ID + sign_id = NEXT_SIGN_ID + NEXT_SIGN_ID += 1 self._signs[ 'breakpoints' ].append( sign_id ) if utils.BufferExists( file_name ): signs.PlaceSign( sign_id, diff --git a/python3/vimspector/custom/python.py b/python3/vimspector/custom/python.py index 8f6f578..2283ee1 100644 --- a/python3/vimspector/custom/python.py +++ b/python3/vimspector/custom/python.py @@ -14,7 +14,7 @@ # limitations under the License. from vimspector.debug_session import DebugSession -from vimspector import session_manager +from vimspector import session_manager, gadgets, utils from typing import Sequence @@ -25,22 +25,53 @@ class Debugpy( object ): def __init__( self, debug_session: DebugSession ): self.parent = debug_session + self.queue = [] + + def LaunchSubprocessDebugSession( self, result ): + launch_arguments = self.queue.pop( 0 ) + + if result == 1: + session = session_manager.Get().NewSession( self.parent._api_prefix ) + + # Inject the launch config (HACK!). This will actually mean that the + # configuration passed below is ignored. + session._launch_config = launch_arguments + + # FIXME: We probably do need to add a StartWithLauncArguments and somehow + # tell the new session that it shoud not support "Restart" requests ? + # + # In fact, what even would Reset do... ? + session._breakpoints.Copy( self.parent._breakpoints ) + session._StartWithConfiguration( { 'configuration': launch_arguments }, + launch_arguments[ 'connect' ] ) + + self.HandleNext() def OnEvent_debugpyAttach( self, message ): # Debugpy sends us the contents of a launch request that we should use. We # probaly just jave to guess the rest - launch_argyments = message[ 'body' ] - session = session_manager.Get().NewSession( self.parent._api_prefix ) + launch_arguments = message[ 'body' ] + self.queue.append( launch_arguments ) - # Inject the launch config (HACK!). This will actually mean that the - # configuration passed below is ignored. - session._launch_config = launch_argyments + # We use a queue because the confirm mechanism is quasi-modal and we can't + # do multiple 'confirm' dialogs at once. It's not uncommon for + # multiprocessing to create multiple subprocesses all at the same time. + if len( self.queue ) == 1: + self.HandleNext() - # FIXME: We probably do need to add a StartWithLauncArguments and somehow - # tell the new session that it shoud not support "Restart" requests ? - # - # In fact, what even would Reset do... ? - session._StartWithConfiguration( self.parent._configuration, - self.parent._adapter ) + def HandleNext( self ): + if not self.queue: + return + + launch_argyments = self.queue[ 0 ] + pid = launch_argyments[ 'subProcessId' ] + + utils.Confirm( + self.parent._api_prefix, + f"Subprocess {pid} was launched.\nAttach to it in a new tab?", + self.LaunchSubprocessDebugSession, + default_value = 1, + options = [ 'Yes', 'No' ], + keys = [ 'y', 'n' ] ) diff --git a/python3/vimspector/debug_adapter_connection.py b/python3/vimspector/debug_adapter_connection.py index d4cc239..edebf68 100644 --- a/python3/vimspector/debug_adapter_connection.py +++ b/python3/vimspector/debug_adapter_connection.py @@ -30,8 +30,8 @@ class PendingRequest( object ): class DebugAdapterConnection( object ): def __init__( self, handlers, session_id, send_func ): - self._logger = logging.getLogger( __name__ ) - utils.SetUpLogging( self._logger ) + self._logger = logging.getLogger( __name__ + '.' + str( session_id ) ) + utils.SetUpLogging( self._logger, session_id ) self._Write = send_func self._SetState( 'READ_HEADER' ) diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index f80c217..82eb70e 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -46,12 +46,13 @@ class DebugSession( object ): def __init__( self, session_id, session_manager, api_prefix ): self.session_id = session_id self.manager = session_manager - self._logger = logging.getLogger( __name__ ) - utils.SetUpLogging( self._logger ) + self._logger = logging.getLogger( __name__ + '.' + str( session_id ) ) + utils.SetUpLogging( self._logger, session_id ) self._api_prefix = api_prefix - self._logger.info( "**** INITIALISING NEW VIMSPECTOR SESSION ****" ) + self._logger.info( "**** INITIALISING NEW VIMSPECTOR SESSION FOR ID " + f"{session_id } ****" ) self._logger.info( "API is: {}".format( api_prefix ) ) self._logger.info( 'VIMSPECTOR_HOME = %s', VIMSPECTOR_HOME ) self._logger.info( 'gadgetDir = %s', @@ -62,7 +63,7 @@ class DebugSession( object ): self._stackTraceView = None self._variablesView = None self._outputView = None - self._breakpoints = breakpoints.ProjectBreakpoints() + self._breakpoints = breakpoints.ProjectBreakpoints( session_id ) self._splash_screen = None self._remote_term = None @@ -414,7 +415,13 @@ class DebugSession( object ): if self._uiTab: self._logger.debug( "Clearing down UI" ) - del vim.vars[ 'vimspector_session_windows' ] + try: + # FIXME: vimspector_session_windows is totally buseted with multiple + # sessions + del vim.vars[ 'vimspector_session_windows' ] + except KeyError: + pass + vim.current.tabpage = self._uiTab self._splash_screen = utils.HideSplash( self._api_prefix, @@ -673,6 +680,15 @@ class DebugSession( object ): def _SetUpUI( self ): vim.command( 'tab split' ) + + # Switch to this session now that we've made it visible. Note that the + # TabEnter autocmd does trigger when the above is run, but that's before the + # following line assigns the tab to this session, so when we try to find + # this session by tab number, it's not found. So we have to manually switch + # to it when creating a new tab. + utils.Call( 'vimspector#internal#state#SwitchToSession', + self.session_id ) + self._uiTab = vim.current.tabpage mode = settings.Get( 'ui_mode' ) @@ -716,7 +732,9 @@ class DebugSession( object ): def _SetUpUIHorizontal( self ): # Code window code_window = vim.current.window - self._codeView = code.CodeView( code_window, self._api_prefix ) + self._codeView = code.CodeView( self.session_id, + code_window, + self._api_prefix ) # Call stack vim.command( @@ -741,7 +759,8 @@ class DebugSession( object ): with utils.LetCurrentWindow( stack_trace_window ): vim.command( f'{ one_third }wincmd _' ) - self._variablesView = variables.VariablesView( vars_window, + self._variablesView = variables.VariablesView( self, + vars_window, watch_window ) # Output/logging @@ -749,7 +768,8 @@ class DebugSession( object ): vim.command( f'rightbelow { settings.Int( "bottombar_height" ) }new' ) output_window = vim.current.window self._outputView = output.DAPOutputView( output_window, - self._api_prefix ) + self._api_prefix, + session_id = self.session_id ) # TODO: If/when we support multiple sessions, we'll need some way to # indicate which tab was created and store all the tabs @@ -772,7 +792,9 @@ class DebugSession( object ): def _SetUpUIVertical( self ): # Code window code_window = vim.current.window - self._codeView = code.CodeView( code_window, self._api_prefix ) + self._codeView = code.CodeView( self.session_id, + code_window, + self._api_prefix ) # Call stack vim.command( @@ -799,7 +821,8 @@ class DebugSession( object ): with utils.LetCurrentWindow( stack_trace_window ): vim.command( f'{ one_third }wincmd |' ) - self._variablesView = variables.VariablesView( vars_window, + self._variablesView = variables.VariablesView( self, + vars_window, watch_window ) @@ -808,7 +831,8 @@ class DebugSession( object ): vim.command( f'rightbelow { settings.Int( "bottombar_height" ) }new' ) output_window = vim.current.window self._outputView = output.DAPOutputView( output_window, - self._api_prefix ) + self._api_prefix, + session_id = self.session_id ) # TODO: If/when we support multiple sessions, we'll need some way to # indicate which tab was created and store all the tabs diff --git a/python3/vimspector/output.py b/python3/vimspector/output.py index 3322b0d..223eb96 100644 --- a/python3/vimspector/output.py +++ b/python3/vimspector/output.py @@ -58,13 +58,17 @@ class OutputView( object ): files or the output of commands.""" _buffers: typing.Dict[ str, TabBuffer ] - def __init__( self, window, api_prefix ): + def __init__( self, window, api_prefix, session_id = None ): self._window = window self._buffers = {} self._api_prefix = api_prefix VIEWS.add( self ) - # FIXME: hack? - self._session_id = hash( self ) + + if session_id is None: + # FIXME: hack? + self._session_id = hash( self ) + else: + self._session_id = session_id def Print( self, categroy, text ): self._Print( 'server', text.splitlines() ) @@ -176,9 +180,9 @@ class OutputView( object ): if cmd is not None: out = utils.SetUpCommandBuffer( - self._session_id, # TODO: not really a session id + self._session_id, cmd, - category, + utils.BufferNameForSession( category, self._session_id ), self._api_prefix, completion_handler = completion_handler ) @@ -191,6 +195,8 @@ class OutputView( object ): else: name = 'vimspector.Output:{0}'.format( category ) + name = utils.BufferNameForSession( name, self._session_id ) + tab_buffer = TabBuffer( utils.NewEmptyBuffer(), len( self._buffers ) ) self._buffers[ category ] = tab_buffer @@ -253,8 +259,8 @@ class OutputView( object ): class DAPOutputView( OutputView ): """Specialised OutputView which adds the DAP Console (REPL)""" - def __init__( self, *args ): - super().__init__( *args ) + def __init__( self, *args, **kwargs ): + super().__init__( *args, **kwargs ) self._connection = None for b in set( BUFFER_MAP.values() ): diff --git a/python3/vimspector/session_manager.py b/python3/vimspector/session_manager.py index e48f03d..1564388 100644 --- a/python3/vimspector/session_manager.py +++ b/python3/vimspector/session_manager.py @@ -22,7 +22,6 @@ _session_manager = None class SessionManager: next_session_id = 0 sessions = {} - current_session = None def NewSession( self, *args, **kwargs ): @@ -31,21 +30,24 @@ class SessionManager: session = DebugSession( session_id, self, *args, **kwargs ) self.sessions[ session_id ] = session - if self.current_session is None: - self.current_session = session.session_id - return session def DestroySession( self, session: DebugSession ): + # TODO: Call this! del self.sessions[ session.session_id ] def GetSession( self, session_id ): return self.sessions.get( session_id ) - def CurrentSession( self ): - return self.GetSession( self.current_session ) + + def SessionForTab( self, tabnr ): + for _, session in self.sessions.items(): + if session._HasUI() and session._uiTab.number == int( tabnr ): + return session + + return None def Get(): diff --git a/python3/vimspector/stack_trace.py b/python3/vimspector/stack_trace.py index ae14e68..f55224a 100644 --- a/python3/vimspector/stack_trace.py +++ b/python3/vimspector/stack_trace.py @@ -86,8 +86,8 @@ class StackTraceView( object ): _line_to_thread = typing.Dict[ int, Thread ] def __init__( self, session, win ): - self._logger = logging.getLogger( __name__ ) - utils.SetUpLogging( self._logger ) + self._logger = logging.getLogger( __name__ + '.' + str( session.session_id ) ) + utils.SetUpLogging( self._logger, session.session_id ) self._buf = win.buffer self._session = session @@ -104,7 +104,10 @@ class StackTraceView( object ): # FIXME: This ID is by group, so should be module scope self._next_sign_id = 1 - utils.SetUpHiddenBuffer( self._buf, 'vimspector.StackTrace' ) + utils.SetUpHiddenBuffer( + self._buf, + utils.BufferNameForSession( 'vimspector.StackTrace', + self._session.session_id ) ) utils.SetUpUIWindow( win ) mappings = settings.Dict( 'mappings' )[ 'stack_trace' ] @@ -562,7 +565,10 @@ class StackTraceView( object ): buf = utils.BufferForFile( buf_name ) self._scratch_buffers.append( buf ) - utils.SetUpHiddenBuffer( buf, buf_name ) + utils.SetUpHiddenBuffer( buf, + utils.BufferNameForSession( + buf_name, + self._session.session_id ) ) source[ 'path' ] = buf_name with utils.ModifiableScratchBuffer( buf ): utils.SetBufferContents( buf, msg[ 'body' ][ 'content' ] ) diff --git a/python3/vimspector/utils.py b/python3/vimspector/utils.py index ef0a077..242d070 100644 --- a/python3/vimspector/utils.py +++ b/python3/vimspector/utils.py @@ -32,13 +32,30 @@ LOG_FILE = os.path.expanduser( os.path.join( '~', '.vimspector.log' ) ) _log_handler = logging.FileHandler( LOG_FILE, mode = 'w' ) _log_handler.setFormatter( - logging.Formatter( '%(asctime)s - %(levelname)s - %(message)s' ) ) + logging.Formatter( '%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - ' + '%(context)s - %(message)s' ) ) -def SetUpLogging( logger ): +class ContextLogFilter( logging.Filter ): + context: str + + def __init__( self, context ): + self.context = str( context ) + + def filter( self, record: logging.LogRecord ): + if self.context is None: + record.context = 'UNKNOWN' + else: + record.context = self.context + + return True + + +def SetUpLogging( logger, context = None ): logger.setLevel( logging.DEBUG ) if _log_handler not in logger.handlers: logger.addHandler( _log_handler ) + logger.addFilter( ContextLogFilter( context ) ) _logger = logging.getLogger( __name__ ) @@ -404,6 +421,8 @@ def Confirm( api_prefix, default_value = 2, options: list = None, keys: list = None ): + # TODO: Implement a queue here? If calling code calls Confirm (async) multiple + # times, we... well what happens?! if not options: options = [ '(Y)es', '(N)o' ] if not keys: @@ -871,3 +890,12 @@ def UseWinBar(): # Buggy neovim doesn't render correctly when the WinBar is defined: # https://github.com/neovim/neovim/issues/12689 return not int( Call( 'has', 'nvim' ) ) + + +def BufferNameForSession( name, session_id ): + if session_id == 0: + # Hack for backward compat - don't suffix with the ID for the "first" + # session + return name + + return f'{name}[{session_id}]' diff --git a/python3/vimspector/variables.py b/python3/vimspector/variables.py index 5cdd712..5f64ba6 100644 --- a/python3/vimspector/variables.py +++ b/python3/vimspector/variables.py @@ -166,10 +166,11 @@ def AddExpandMappings( mappings = None ): class VariablesView( object ): - def __init__( self, variables_win, watches_win ): - self._logger = logging.getLogger( __name__ ) - utils.SetUpLogging( self._logger ) + def __init__( self, session, variables_win, watches_win ): + self._logger = logging.getLogger( __name__ + '.' + str( session.session_id ) ) + utils.SetUpLogging( self._logger, session.session_id ) + self._session = session self._connection = None self._current_syntax = '' self._server_capabilities = None @@ -182,7 +183,10 @@ class VariablesView( object ): # Set up the "Variables" buffer in the variables_win self._scopes: typing.List[ Scope ] = [] self._vars = View( variables_win, {}, self._DrawScopes ) - utils.SetUpHiddenBuffer( self._vars.buf, 'vimspector.Variables' ) + utils.SetUpHiddenBuffer( + self._vars.buf, + utils.BufferNameForSession( 'vimspector.Variables', + self._session.session_id ) ) with utils.LetCurrentWindow( variables_win ): if utils.UseWinBar(): vim.command( 'nnoremenu 1.1 WinBar.Set ' @@ -193,11 +197,14 @@ class VariablesView( object ): # there) self._watches: typing.List[ Watch ] = [] self._watch = View( watches_win, {}, self._DrawWatches ) - utils.SetUpPromptBuffer( self._watch.buf, - 'vimspector.Watches', - 'Expression: ', - 'vimspector#AddWatchPrompt', - 'vimspector#OmniFuncWatch' ) + utils.SetUpPromptBuffer( + self._watch.buf, + utils.BufferNameForSession( 'vimspector.Watches', + self._session.session_id ), + 'Expression: ', + 'vimspector#AddWatchPrompt', + 'vimspector#OmniFuncWatch' ) + with utils.LetCurrentWindow( watches_win ): AddExpandMappings( mappings ) for mapping in utils.GetVimList( mappings, 'delete' ): diff --git a/support/test/python/multiprocessing/.vimspector.json b/support/test/python/multiprocessing/.vimspector.json index 66272e3..6eee4c7 100644 --- a/support/test/python/multiprocessing/.vimspector.json +++ b/support/test/python/multiprocessing/.vimspector.json @@ -8,7 +8,26 @@ "type": "python", "cwd": "${workspaceRoot}", "program": "${file}", - "stopOnEntry": false, + "stopOnEntry": true, + "console": "integratedTerminal", + "subProcess": true + }, + "breakpoints": { + "exception": { + "raised": "N", + "uncaught": "Y", + "userUnhandled": "" + } + } + }, + "attach": { + "adapter": "multi-session", + "configuration": { + "request": "attach", + "type": "python", + "cwd": "${workspaceRoot}", + "program": "${file}", + "stopOnEntry": true, "console": "integratedTerminal", "subProcess": true }, diff --git a/support/test/python/multiprocessing/multiprocessing_test.py b/support/test/python/multiprocessing/multiprocessing_test.py index 1a4d0a7..c00d86d 100644 --- a/support/test/python/multiprocessing/multiprocessing_test.py +++ b/support/test/python/multiprocessing/multiprocessing_test.py @@ -3,25 +3,16 @@ import multiprocessing as mp def First(): - for _ in range( 100 ): - print( "in first" ) + for i in range( 10 ): + print( f"in first x {i}" ) time.sleep( 0.1 ) -def Second(): - for _ in range( 100 ): - print( "in second" ) - time.sleep( 0.1 ) +if __name__ == '__main__': + print( "main" ) + p1 = mp.Process( target=First ) + p1.start() + p1.join() -print( "main" ) -p1 = mp.Process( target=First ) -p2 = mp.Process( target=Second ) - -p1.start() -p2.start() - -p1.join() -p2.join() - -print( "Done" ) + print( "Done" ) From d70d51a614a11f03a64294a48aca134634053713 Mon Sep 17 00:00:00 2001 From: Tony Dwire Date: Wed, 7 Apr 2021 11:50:26 -0500 Subject: [PATCH 06/47] Updated netcoredbg to 1.2.0-761 to enable mac support of async/await --- python3/vimspector/gadgets.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index d2c280b..8be7db7 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -234,11 +234,10 @@ GADGETS = { 'format': 'tar', }, 'all': { - 'version': '1.2.0-738' + 'version': '1.2.0-761' }, 'macos': { 'file_name': 'netcoredbg-osx.tar.gz', - 'version': '1.2.0-635', 'checksum': '71c773e34d358950f25119bade7e3081c4c2f9d71847bd49027ca5792e918beb', }, From 7d83419a4f813aee826eee994b8e419b6ff102b0 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 7 Apr 2021 22:45:58 +0100 Subject: [PATCH 07/47] Update docs bundles --- docs/Gemfile.lock | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index d2eb55f..6a18520 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.4) + activesupport (6.0.3.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -16,7 +16,7 @@ GEM colorator (1.1.0) commonmarker (0.17.13) ruby-enum (~> 0.5) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.8) dnsruby (1.61.5) simpleidn (~> 0.1) em-websocket (0.5.2) @@ -30,12 +30,12 @@ GEM faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) ruby2_keywords - faraday-net_http (1.0.0) - ffi (1.14.2) + faraday-net_http (1.0.1) + ffi (1.15.0) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (209) - github-pages-health-check (= 1.16.1) + github-pages (214) + github-pages-health-check (= 1.17.0) jekyll (= 3.9.0) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) @@ -50,9 +50,9 @@ GEM jekyll-readme-index (= 0.3.0) jekyll-redirect-from (= 0.16.0) jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.2) + jekyll-remote-theme (= 0.4.3) jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.6.1) + jekyll-seo-tag (= 2.7.1) jekyll-sitemap (= 1.4.0) jekyll-swiss (= 1.0.0) jekyll-theme-architect (= 0.1.1) @@ -70,19 +70,19 @@ GEM jekyll-theme-time-machine (= 0.1.1) jekyll-titles-from-headings (= 0.5.3) jemoji (= 0.12.0) - kramdown (= 2.3.0) + kramdown (= 2.3.1) kramdown-parser-gfm (= 1.1.0) liquid (= 4.0.3) mercenary (~> 0.3) minima (= 2.5.1) nokogiri (>= 1.10.4, < 2.0) - rouge (= 3.23.0) + rouge (= 3.26.0) terminal-table (~> 1.4) - github-pages-health-check (1.16.1) + github-pages-health-check (1.17.0) addressable (~> 2.3) dnsruby (~> 1.60) octokit (~> 4.0) - public_suffix (~> 3.0) + public_suffix (>= 2.0.2, < 5.0) typhoeus (~> 1.3) html-pipeline (2.14.0) activesupport (>= 2) @@ -136,15 +136,15 @@ GEM jekyll (>= 3.3, < 5.0) jekyll-relative-links (0.6.1) jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.2) + jekyll-remote-theme (0.4.3) addressable (~> 2.0) jekyll (>= 3.5, < 5.0) jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.6.1) - jekyll (>= 3.3, < 5.0) + jekyll-seo-tag (2.7.1) + jekyll (>= 3.8, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-swiss (1.0.0) @@ -196,12 +196,12 @@ GEM gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) - kramdown (2.3.0) + kramdown (2.3.1) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.3) - listen (3.4.0) + listen (3.5.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) @@ -210,9 +210,9 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.3) + minitest (5.14.4) multipart-post (2.1.1) - nokogiri (1.11.1) + nokogiri (1.11.3) mini_portile2 (~> 2.5.0) racc (~> 1.4) octokit (4.20.0) @@ -220,16 +220,16 @@ GEM sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (3.1.1) + public_suffix (4.0.6) racc (1.5.2) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.4) - rouge (3.23.0) - ruby-enum (0.8.0) + rexml (3.2.5) + rouge (3.26.0) + ruby-enum (0.9.0) i18n - ruby2_keywords (0.0.2) + ruby2_keywords (0.0.4) rubyzip (2.3.0) safe_yaml (1.0.5) sass (3.7.4) @@ -240,7 +240,7 @@ GEM sawyer (0.8.2) addressable (>= 2.3.5) faraday (> 0.8, < 2.0) - simpleidn (0.1.1) + simpleidn (0.2.1) unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) From 13a5a1b947825f710a0aacc0fd8167bd3d42822c Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 9 Apr 2021 16:54:38 +0100 Subject: [PATCH 08/47] Fix traceback when +python3 is not availble --- autoload/vimspector.vim | 3 +++ docs/configuration.md | 2 +- plugin/vimspector.vim | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/vimspector.vim b/autoload/vimspector.vim index a0b6c42..1219661 100644 --- a/autoload/vimspector.vim +++ b/autoload/vimspector.vim @@ -13,6 +13,9 @@ " See the License for the specific language governing permissions and " limitations under the License. +if !has( 'python3' ) + finish +endif " Boilerplate {{{ let s:save_cpo = &cpoptions diff --git a/docs/configuration.md b/docs/configuration.md index e736985..a2864b1 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -271,7 +271,7 @@ JSON value `true`, and the suffix is stripped fom the key, resulting in the following: ```json - "stopOnEntry#json": true + "stopOnEntry": true ``` Which is what we need. diff --git a/plugin/vimspector.vim b/plugin/vimspector.vim index 75e2baa..27ce473 100644 --- a/plugin/vimspector.vim +++ b/plugin/vimspector.vim @@ -13,6 +13,13 @@ " See the License for the specific language governing permissions and " limitations under the License. +if !has( 'python3' ) + echohl WarningMsg + echom 'Vimspector unavailable: Requires Vim compiled with +python3' + echohl None + finish +endif + " Boilerplate {{{ let s:save_cpo = &cpoptions set cpoptions&vim From 278fc3cd8c285e3e2f6abff824592a18186912bd Mon Sep 17 00:00:00 2001 From: Tony Dwire Date: Fri, 9 Apr 2021 11:29:17 -0500 Subject: [PATCH 09/47] Update sha256sum of netcoredbg --- python3/vimspector/gadgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 8be7db7..7b807b6 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -239,7 +239,7 @@ GADGETS = { 'macos': { 'file_name': 'netcoredbg-osx.tar.gz', 'checksum': - '71c773e34d358950f25119bade7e3081c4c2f9d71847bd49027ca5792e918beb', + '994e0d001f53af058c94468336dfd1f166a3f3540c9e0de4f9f45f59e6c969fe', }, 'linux': { 'file_name': 'netcoredbg-linux-bionic-amd64.tar.gz', From fa92c2a8d525972bcc97cba9579d9adfca3c859a Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sun, 11 Apr 2021 19:23:47 +0100 Subject: [PATCH 10/47] Add a mode for debugging the extremely flaky netcoredbg --- support/test/csharp/.vimspector.json | 65 ++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/support/test/csharp/.vimspector.json b/support/test/csharp/.vimspector.json index 524ae1a..8b2c499 100644 --- a/support/test/csharp/.vimspector.json +++ b/support/test/csharp/.vimspector.json @@ -1,25 +1,52 @@ { - "configurations": { - "launch - netcoredbg": { - "adapter": "netcoredbg", - "configuration": { - "request": "launch", - "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", - "args": [], - "stopAtEntry": true - } + "adapters": { + "netcoredbg-debuglog": { + "attach": { + "pidProperty": "processId", + "pidSelect": "ask" }, - "launch - mono": { - "adapter": "vscode-mono-debug", - "configuration": { - "request": "launch", - "program": "${workspaceRoot}/Program.exe", - "console": "integratedTerminal", - "cwd": "${workspaceRoot}", - "args": [], - "env": {} - } + "command": [ + "${gadgetDir}/netcoredbg/netcoredbg", + "--interpreter=vscode", + "--engineLogging=${workspaceRoot}/netcoredbg.engine.log", + "--log=${workspaceRoot}/netcoredbg.log" + ], + "configuration": { + "cwd": "${workspaceRoot}" + }, + "name": "netcoredbg" + } + }, + "configurations": { + "launch - netcoredbg": { + "adapter": "netcoredbg", + "configuration": { + "request": "launch", + "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", + "args": [], + "stopAtEntry": true + } + }, + "launch - netcoredbg - with debug log": { + "adapter": "netcoredbg-debuglog", + "configuration": { + "request": "launch", + "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", + "args": [], + "stopAtEntry": true + } + }, + "launch - mono": { + "adapter": "vscode-mono-debug", + "configuration": { + "request": "launch", + "program": "${workspaceRoot}/Program.exe", + "console": "integratedTerminal", + "cwd": "${workspaceRoot}", + "args": [], + "env": {} } } + } } From dd88e051a408e828af1d54ce8c98e18f41c64b5d Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 13 Apr 2021 17:34:51 +0100 Subject: [PATCH 11/47] Attempt to recover from broken messages --- python3/vimspector/debug_adapter_connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3/vimspector/debug_adapter_connection.py b/python3/vimspector/debug_adapter_connection.py index df2ef13..206938a 100644 --- a/python3/vimspector/debug_adapter_connection.py +++ b/python3/vimspector/debug_adapter_connection.py @@ -226,7 +226,12 @@ class DebugAdapterConnection( object ): # self._logger.debug( 'Message received (raw): %s', payload ) - message = json.loads( payload ) + try: + message = json.loads( payload, strict = False ) + except Exception: + self._logger.exception( "Invalid message received: %s", payload ) + self._SetState( 'READ_HEADER' ) + raise self._logger.debug( 'Message received: {0}'.format( message ) ) From a41db89523723dbdde6b3f1381e4de321e67b78c Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 13 Apr 2021 18:01:10 +0100 Subject: [PATCH 12/47] Fix get_configurations test --- support/test/csharp/.vimspector.json | 5 +++++ tests/get_configurations.test.vim | 1 + 2 files changed, 6 insertions(+) diff --git a/support/test/csharp/.vimspector.json b/support/test/csharp/.vimspector.json index 8b2c499..ae796e5 100644 --- a/support/test/csharp/.vimspector.json +++ b/support/test/csharp/.vimspector.json @@ -18,6 +18,11 @@ } }, "configurations": { + // + // NOTE: + // If you add to this, you must update tests/get_configurations.test.vim + // + "launch - netcoredbg": { "adapter": "netcoredbg", "configuration": { diff --git a/tests/get_configurations.test.vim b/tests/get_configurations.test.vim index 4a37d01..33e6577 100644 --- a/tests/get_configurations.test.vim +++ b/tests/get_configurations.test.vim @@ -12,6 +12,7 @@ function Test_Get_Configurations() let configs = vimspector#GetConfigurations() call assert_equal([ \ 'launch - netcoredbg', + \ 'launch - netcoredbg - with debug log', \ 'launch - mono', \ ], configs) From 6ad9101cf27f6d07d2f68fe04762e055869ec2d7 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 15 Apr 2021 15:02:46 +0100 Subject: [PATCH 13/47] Add FAQ about json files in each project. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6979e44..ae0ef46 100644 --- a/README.md +++ b/README.md @@ -2070,6 +2070,10 @@ hi link jsonComment Comment Debug adapters (for some reason) send telemetry data to clients. Vimspector simply displays this information in the output window. It *does not* and *will not ever* collect, use, forward or otherwise share any data with any third parties. +10. Do I _have_ to put a `.vimspector.json` in the root of every project? No, you + can put all of your adapter and debug configs in a [single directory](https://puremourning.github.io/vimspector/configuration.html#debug-configurations) if you want to, but note + the caveat that `${workspaceRoot}` won't be calculated correctly in that case. + The vimsepctor author uses this [a lot](https://github.com/puremourning/.vim-mac/tree/master/vimspector-conf). [ycmd]: https://github.com/Valloric/ycmd From b4195eee93846da6c73241520751b20a25bdbab7 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 15 Apr 2021 18:02:55 +0100 Subject: [PATCH 14/47] Upgrade to netcoredbg v1.2.0-782 Also upgrade the test project to LTS 3.1 dotnet framework, as MS is making it very difficult to get framework 2.2 anymore. Also remove some object files which apparently were included in the repo. --- python3/vimspector/gadgets.py | 4 +- support/test/csharp/.gitignore | 1 + support/test/csharp/.vimspector.json | 4 +- support/test/csharp/csharp.csproj | 2 +- .../test/csharp/obj/csharp.csproj.nuget.cache | 5 - .../csharp/obj/csharp.csproj.nuget.g.props | 21 - .../csharp/obj/csharp.csproj.nuget.g.targets | 10 - support/test/csharp/obj/project.assets.json | 748 ------------------ 8 files changed, 6 insertions(+), 789 deletions(-) delete mode 100644 support/test/csharp/obj/csharp.csproj.nuget.cache delete mode 100644 support/test/csharp/obj/csharp.csproj.nuget.g.props delete mode 100644 support/test/csharp/obj/csharp.csproj.nuget.g.targets delete mode 100644 support/test/csharp/obj/project.assets.json diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 7b807b6..6b28095 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -234,12 +234,12 @@ GADGETS = { 'format': 'tar', }, 'all': { - 'version': '1.2.0-761' + 'version': '1.2.0-782' }, 'macos': { 'file_name': 'netcoredbg-osx.tar.gz', 'checksum': - '994e0d001f53af058c94468336dfd1f166a3f3540c9e0de4f9f45f59e6c969fe', + '', }, 'linux': { 'file_name': 'netcoredbg-linux-bionic-amd64.tar.gz', diff --git a/support/test/csharp/.gitignore b/support/test/csharp/.gitignore index b7d74e4..03cd7d8 100644 --- a/support/test/csharp/.gitignore +++ b/support/test/csharp/.gitignore @@ -1,2 +1,3 @@ bin/ obj/Debug +obj/ diff --git a/support/test/csharp/.vimspector.json b/support/test/csharp/.vimspector.json index ae796e5..3bfb0f3 100644 --- a/support/test/csharp/.vimspector.json +++ b/support/test/csharp/.vimspector.json @@ -27,7 +27,7 @@ "adapter": "netcoredbg", "configuration": { "request": "launch", - "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", + "program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll", "args": [], "stopAtEntry": true } @@ -36,7 +36,7 @@ "adapter": "netcoredbg-debuglog", "configuration": { "request": "launch", - "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", + "program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll", "args": [], "stopAtEntry": true } diff --git a/support/test/csharp/csharp.csproj b/support/test/csharp/csharp.csproj index 01d5113..d453e9a 100644 --- a/support/test/csharp/csharp.csproj +++ b/support/test/csharp/csharp.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.2 + netcoreapp3.1 diff --git a/support/test/csharp/obj/csharp.csproj.nuget.cache b/support/test/csharp/obj/csharp.csproj.nuget.cache deleted file mode 100644 index 3ac8d84..0000000 --- a/support/test/csharp/obj/csharp.csproj.nuget.cache +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": 1, - "dgSpecHash": "6/vdr7YprlSIoQecv/nNuLNflFpO0X7eN7jHUinZTsgian9nYpmHMWirsDWMi5l+29TH+Qy8O/QfaB/48QtjRQ==", - "success": true -} \ No newline at end of file diff --git a/support/test/csharp/obj/csharp.csproj.nuget.g.props b/support/test/csharp/obj/csharp.csproj.nuget.g.props deleted file mode 100644 index c71f0e6..0000000 --- a/support/test/csharp/obj/csharp.csproj.nuget.g.props +++ /dev/null @@ -1,21 +0,0 @@ - - - - True - NuGet - $(MSBuildThisFileDirectory)project.assets.json - /Users/ben/.nuget/packages/ - /Users/ben/.nuget/packages/;/usr/local/share/dotnet/sdk/NuGetFallbackFolder - PackageReference - 5.7.0 - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - \ No newline at end of file diff --git a/support/test/csharp/obj/csharp.csproj.nuget.g.targets b/support/test/csharp/obj/csharp.csproj.nuget.g.targets deleted file mode 100644 index 099158b..0000000 --- a/support/test/csharp/obj/csharp.csproj.nuget.g.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - \ No newline at end of file diff --git a/support/test/csharp/obj/project.assets.json b/support/test/csharp/obj/project.assets.json deleted file mode 100644 index bd6c0fc..0000000 --- a/support/test/csharp/obj/project.assets.json +++ /dev/null @@ -1,748 +0,0 @@ -{ - "version": 3, - "targets": { - ".NETCoreApp,Version=v2.2": { - "Microsoft.NETCore.App/2.2.0": { - "type": "package", - "dependencies": { - "Microsoft.NETCore.DotNetHostPolicy": "2.2.0", - "Microsoft.NETCore.Platforms": "2.2.0", - "Microsoft.NETCore.Targets": "2.0.0", - "NETStandard.Library": "2.0.3" - }, - "compile": { - "ref/netcoreapp2.2/Microsoft.CSharp.dll": {}, - "ref/netcoreapp2.2/Microsoft.VisualBasic.dll": {}, - "ref/netcoreapp2.2/Microsoft.Win32.Primitives.dll": {}, - "ref/netcoreapp2.2/System.AppContext.dll": {}, - "ref/netcoreapp2.2/System.Buffers.dll": {}, - "ref/netcoreapp2.2/System.Collections.Concurrent.dll": {}, - "ref/netcoreapp2.2/System.Collections.Immutable.dll": {}, - "ref/netcoreapp2.2/System.Collections.NonGeneric.dll": {}, - "ref/netcoreapp2.2/System.Collections.Specialized.dll": {}, - "ref/netcoreapp2.2/System.Collections.dll": {}, - "ref/netcoreapp2.2/System.ComponentModel.Annotations.dll": {}, - "ref/netcoreapp2.2/System.ComponentModel.DataAnnotations.dll": {}, - "ref/netcoreapp2.2/System.ComponentModel.EventBasedAsync.dll": {}, - "ref/netcoreapp2.2/System.ComponentModel.Primitives.dll": {}, - "ref/netcoreapp2.2/System.ComponentModel.TypeConverter.dll": {}, - "ref/netcoreapp2.2/System.ComponentModel.dll": {}, - "ref/netcoreapp2.2/System.Configuration.dll": {}, - "ref/netcoreapp2.2/System.Console.dll": {}, - "ref/netcoreapp2.2/System.Core.dll": {}, - "ref/netcoreapp2.2/System.Data.Common.dll": {}, - "ref/netcoreapp2.2/System.Data.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.Contracts.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.Debug.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.DiagnosticSource.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.FileVersionInfo.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.Process.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.StackTrace.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.TextWriterTraceListener.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.Tools.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.TraceSource.dll": {}, - "ref/netcoreapp2.2/System.Diagnostics.Tracing.dll": {}, - "ref/netcoreapp2.2/System.Drawing.Primitives.dll": {}, - "ref/netcoreapp2.2/System.Drawing.dll": {}, - "ref/netcoreapp2.2/System.Dynamic.Runtime.dll": {}, - "ref/netcoreapp2.2/System.Globalization.Calendars.dll": {}, - "ref/netcoreapp2.2/System.Globalization.Extensions.dll": {}, - "ref/netcoreapp2.2/System.Globalization.dll": {}, - "ref/netcoreapp2.2/System.IO.Compression.Brotli.dll": {}, - "ref/netcoreapp2.2/System.IO.Compression.FileSystem.dll": {}, - "ref/netcoreapp2.2/System.IO.Compression.ZipFile.dll": {}, - "ref/netcoreapp2.2/System.IO.Compression.dll": {}, - "ref/netcoreapp2.2/System.IO.FileSystem.DriveInfo.dll": {}, - "ref/netcoreapp2.2/System.IO.FileSystem.Primitives.dll": {}, - "ref/netcoreapp2.2/System.IO.FileSystem.Watcher.dll": {}, - "ref/netcoreapp2.2/System.IO.FileSystem.dll": {}, - "ref/netcoreapp2.2/System.IO.IsolatedStorage.dll": {}, - "ref/netcoreapp2.2/System.IO.MemoryMappedFiles.dll": {}, - "ref/netcoreapp2.2/System.IO.Pipes.dll": {}, - "ref/netcoreapp2.2/System.IO.UnmanagedMemoryStream.dll": {}, - "ref/netcoreapp2.2/System.IO.dll": {}, - "ref/netcoreapp2.2/System.Linq.Expressions.dll": {}, - "ref/netcoreapp2.2/System.Linq.Parallel.dll": {}, - "ref/netcoreapp2.2/System.Linq.Queryable.dll": {}, - "ref/netcoreapp2.2/System.Linq.dll": {}, - "ref/netcoreapp2.2/System.Memory.dll": {}, - "ref/netcoreapp2.2/System.Net.Http.dll": {}, - "ref/netcoreapp2.2/System.Net.HttpListener.dll": {}, - "ref/netcoreapp2.2/System.Net.Mail.dll": {}, - "ref/netcoreapp2.2/System.Net.NameResolution.dll": {}, - "ref/netcoreapp2.2/System.Net.NetworkInformation.dll": {}, - "ref/netcoreapp2.2/System.Net.Ping.dll": {}, - "ref/netcoreapp2.2/System.Net.Primitives.dll": {}, - "ref/netcoreapp2.2/System.Net.Requests.dll": {}, - "ref/netcoreapp2.2/System.Net.Security.dll": {}, - "ref/netcoreapp2.2/System.Net.ServicePoint.dll": {}, - "ref/netcoreapp2.2/System.Net.Sockets.dll": {}, - "ref/netcoreapp2.2/System.Net.WebClient.dll": {}, - "ref/netcoreapp2.2/System.Net.WebHeaderCollection.dll": {}, - "ref/netcoreapp2.2/System.Net.WebProxy.dll": {}, - "ref/netcoreapp2.2/System.Net.WebSockets.Client.dll": {}, - "ref/netcoreapp2.2/System.Net.WebSockets.dll": {}, - "ref/netcoreapp2.2/System.Net.dll": {}, - "ref/netcoreapp2.2/System.Numerics.Vectors.dll": {}, - "ref/netcoreapp2.2/System.Numerics.dll": {}, - "ref/netcoreapp2.2/System.ObjectModel.dll": {}, - "ref/netcoreapp2.2/System.Reflection.DispatchProxy.dll": {}, - "ref/netcoreapp2.2/System.Reflection.Emit.ILGeneration.dll": {}, - "ref/netcoreapp2.2/System.Reflection.Emit.Lightweight.dll": {}, - "ref/netcoreapp2.2/System.Reflection.Emit.dll": {}, - "ref/netcoreapp2.2/System.Reflection.Extensions.dll": {}, - "ref/netcoreapp2.2/System.Reflection.Metadata.dll": {}, - "ref/netcoreapp2.2/System.Reflection.Primitives.dll": {}, - "ref/netcoreapp2.2/System.Reflection.TypeExtensions.dll": {}, - "ref/netcoreapp2.2/System.Reflection.dll": {}, - "ref/netcoreapp2.2/System.Resources.Reader.dll": {}, - "ref/netcoreapp2.2/System.Resources.ResourceManager.dll": {}, - "ref/netcoreapp2.2/System.Resources.Writer.dll": {}, - "ref/netcoreapp2.2/System.Runtime.CompilerServices.VisualC.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Extensions.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Handles.dll": {}, - "ref/netcoreapp2.2/System.Runtime.InteropServices.RuntimeInformation.dll": {}, - "ref/netcoreapp2.2/System.Runtime.InteropServices.WindowsRuntime.dll": {}, - "ref/netcoreapp2.2/System.Runtime.InteropServices.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Loader.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Numerics.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Serialization.Formatters.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Serialization.Json.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Serialization.Primitives.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Serialization.Xml.dll": {}, - "ref/netcoreapp2.2/System.Runtime.Serialization.dll": {}, - "ref/netcoreapp2.2/System.Runtime.dll": {}, - "ref/netcoreapp2.2/System.Security.Claims.dll": {}, - "ref/netcoreapp2.2/System.Security.Cryptography.Algorithms.dll": {}, - "ref/netcoreapp2.2/System.Security.Cryptography.Csp.dll": {}, - "ref/netcoreapp2.2/System.Security.Cryptography.Encoding.dll": {}, - "ref/netcoreapp2.2/System.Security.Cryptography.Primitives.dll": {}, - "ref/netcoreapp2.2/System.Security.Cryptography.X509Certificates.dll": {}, - "ref/netcoreapp2.2/System.Security.Principal.dll": {}, - "ref/netcoreapp2.2/System.Security.SecureString.dll": {}, - "ref/netcoreapp2.2/System.Security.dll": {}, - "ref/netcoreapp2.2/System.ServiceModel.Web.dll": {}, - "ref/netcoreapp2.2/System.ServiceProcess.dll": {}, - "ref/netcoreapp2.2/System.Text.Encoding.Extensions.dll": {}, - "ref/netcoreapp2.2/System.Text.Encoding.dll": {}, - "ref/netcoreapp2.2/System.Text.RegularExpressions.dll": {}, - "ref/netcoreapp2.2/System.Threading.Overlapped.dll": {}, - "ref/netcoreapp2.2/System.Threading.Tasks.Dataflow.dll": {}, - "ref/netcoreapp2.2/System.Threading.Tasks.Extensions.dll": {}, - "ref/netcoreapp2.2/System.Threading.Tasks.Parallel.dll": {}, - "ref/netcoreapp2.2/System.Threading.Tasks.dll": {}, - "ref/netcoreapp2.2/System.Threading.Thread.dll": {}, - "ref/netcoreapp2.2/System.Threading.ThreadPool.dll": {}, - "ref/netcoreapp2.2/System.Threading.Timer.dll": {}, - "ref/netcoreapp2.2/System.Threading.dll": {}, - "ref/netcoreapp2.2/System.Transactions.Local.dll": {}, - "ref/netcoreapp2.2/System.Transactions.dll": {}, - "ref/netcoreapp2.2/System.ValueTuple.dll": {}, - "ref/netcoreapp2.2/System.Web.HttpUtility.dll": {}, - "ref/netcoreapp2.2/System.Web.dll": {}, - "ref/netcoreapp2.2/System.Windows.dll": {}, - "ref/netcoreapp2.2/System.Xml.Linq.dll": {}, - "ref/netcoreapp2.2/System.Xml.ReaderWriter.dll": {}, - "ref/netcoreapp2.2/System.Xml.Serialization.dll": {}, - "ref/netcoreapp2.2/System.Xml.XDocument.dll": {}, - "ref/netcoreapp2.2/System.Xml.XPath.XDocument.dll": {}, - "ref/netcoreapp2.2/System.Xml.XPath.dll": {}, - "ref/netcoreapp2.2/System.Xml.XmlDocument.dll": {}, - "ref/netcoreapp2.2/System.Xml.XmlSerializer.dll": {}, - "ref/netcoreapp2.2/System.Xml.dll": {}, - "ref/netcoreapp2.2/System.dll": {}, - "ref/netcoreapp2.2/WindowsBase.dll": {}, - "ref/netcoreapp2.2/mscorlib.dll": {}, - "ref/netcoreapp2.2/netstandard.dll": {} - }, - "build": { - "build/netcoreapp2.2/Microsoft.NETCore.App.props": {}, - "build/netcoreapp2.2/Microsoft.NETCore.App.targets": {} - } - }, - "Microsoft.NETCore.DotNetAppHost/2.2.0": { - "type": "package" - }, - "Microsoft.NETCore.DotNetHostPolicy/2.2.0": { - "type": "package", - "dependencies": { - "Microsoft.NETCore.DotNetHostResolver": "2.2.0" - } - }, - "Microsoft.NETCore.DotNetHostResolver/2.2.0": { - "type": "package", - "dependencies": { - "Microsoft.NETCore.DotNetAppHost": "2.2.0" - } - }, - "Microsoft.NETCore.Platforms/2.2.0": { - "type": "package", - "compile": { - "lib/netstandard1.0/_._": {} - }, - "runtime": { - "lib/netstandard1.0/_._": {} - } - }, - "Microsoft.NETCore.Targets/2.0.0": { - "type": "package", - "compile": { - "lib/netstandard1.0/_._": {} - }, - "runtime": { - "lib/netstandard1.0/_._": {} - } - }, - "NETStandard.Library/2.0.3": { - "type": "package", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - }, - "compile": { - "lib/netstandard1.0/_._": {} - }, - "runtime": { - "lib/netstandard1.0/_._": {} - }, - "build": { - "build/netstandard2.0/NETStandard.Library.targets": {} - } - } - } - }, - "libraries": { - "Microsoft.NETCore.App/2.2.0": { - "sha512": "7z5l8Jp324S8bU8+yyWeYHXUFYvKyiI5lqS1dXgTzOx1H69Qbf6df12kCKlNX45LpMfCMd4U3M6p7Rl5Zk7SLA==", - "type": "package", - "path": "microsoft.netcore.app/2.2.0", - "files": [ - ".nupkg.metadata", - ".signature.p7s", - "LICENSE.TXT", - "Microsoft.NETCore.App.versions.txt", - "THIRD-PARTY-NOTICES.TXT", - "build/netcoreapp2.2/Microsoft.NETCore.App.PlatformManifest.txt", - "build/netcoreapp2.2/Microsoft.NETCore.App.props", - "build/netcoreapp2.2/Microsoft.NETCore.App.targets", - "microsoft.netcore.app.2.2.0.nupkg.sha512", - "microsoft.netcore.app.nuspec", - "ref/netcoreapp2.2/Microsoft.CSharp.dll", - "ref/netcoreapp2.2/Microsoft.CSharp.xml", - "ref/netcoreapp2.2/Microsoft.VisualBasic.dll", - "ref/netcoreapp2.2/Microsoft.VisualBasic.xml", - "ref/netcoreapp2.2/Microsoft.Win32.Primitives.dll", - "ref/netcoreapp2.2/Microsoft.Win32.Primitives.xml", - "ref/netcoreapp2.2/System.AppContext.dll", - "ref/netcoreapp2.2/System.Buffers.dll", - "ref/netcoreapp2.2/System.Buffers.xml", - "ref/netcoreapp2.2/System.Collections.Concurrent.dll", - "ref/netcoreapp2.2/System.Collections.Concurrent.xml", - "ref/netcoreapp2.2/System.Collections.Immutable.dll", - "ref/netcoreapp2.2/System.Collections.Immutable.xml", - "ref/netcoreapp2.2/System.Collections.NonGeneric.dll", - "ref/netcoreapp2.2/System.Collections.NonGeneric.xml", - "ref/netcoreapp2.2/System.Collections.Specialized.dll", - "ref/netcoreapp2.2/System.Collections.Specialized.xml", - "ref/netcoreapp2.2/System.Collections.dll", - "ref/netcoreapp2.2/System.Collections.xml", - "ref/netcoreapp2.2/System.ComponentModel.Annotations.dll", - "ref/netcoreapp2.2/System.ComponentModel.Annotations.xml", - "ref/netcoreapp2.2/System.ComponentModel.DataAnnotations.dll", - "ref/netcoreapp2.2/System.ComponentModel.EventBasedAsync.dll", - "ref/netcoreapp2.2/System.ComponentModel.EventBasedAsync.xml", - "ref/netcoreapp2.2/System.ComponentModel.Primitives.dll", - "ref/netcoreapp2.2/System.ComponentModel.Primitives.xml", - "ref/netcoreapp2.2/System.ComponentModel.TypeConverter.dll", - "ref/netcoreapp2.2/System.ComponentModel.TypeConverter.xml", - "ref/netcoreapp2.2/System.ComponentModel.dll", - "ref/netcoreapp2.2/System.ComponentModel.xml", - "ref/netcoreapp2.2/System.Configuration.dll", - "ref/netcoreapp2.2/System.Console.dll", - "ref/netcoreapp2.2/System.Console.xml", - "ref/netcoreapp2.2/System.Core.dll", - "ref/netcoreapp2.2/System.Data.Common.dll", - "ref/netcoreapp2.2/System.Data.Common.xml", - "ref/netcoreapp2.2/System.Data.dll", - "ref/netcoreapp2.2/System.Diagnostics.Contracts.dll", - "ref/netcoreapp2.2/System.Diagnostics.Contracts.xml", - "ref/netcoreapp2.2/System.Diagnostics.Debug.dll", - "ref/netcoreapp2.2/System.Diagnostics.Debug.xml", - "ref/netcoreapp2.2/System.Diagnostics.DiagnosticSource.dll", - "ref/netcoreapp2.2/System.Diagnostics.DiagnosticSource.xml", - "ref/netcoreapp2.2/System.Diagnostics.FileVersionInfo.dll", - "ref/netcoreapp2.2/System.Diagnostics.FileVersionInfo.xml", - "ref/netcoreapp2.2/System.Diagnostics.Process.dll", - "ref/netcoreapp2.2/System.Diagnostics.Process.xml", - "ref/netcoreapp2.2/System.Diagnostics.StackTrace.dll", - "ref/netcoreapp2.2/System.Diagnostics.StackTrace.xml", - "ref/netcoreapp2.2/System.Diagnostics.TextWriterTraceListener.dll", - "ref/netcoreapp2.2/System.Diagnostics.TextWriterTraceListener.xml", - "ref/netcoreapp2.2/System.Diagnostics.Tools.dll", - "ref/netcoreapp2.2/System.Diagnostics.Tools.xml", - "ref/netcoreapp2.2/System.Diagnostics.TraceSource.dll", - "ref/netcoreapp2.2/System.Diagnostics.TraceSource.xml", - "ref/netcoreapp2.2/System.Diagnostics.Tracing.dll", - "ref/netcoreapp2.2/System.Diagnostics.Tracing.xml", - "ref/netcoreapp2.2/System.Drawing.Primitives.dll", - "ref/netcoreapp2.2/System.Drawing.Primitives.xml", - "ref/netcoreapp2.2/System.Drawing.dll", - "ref/netcoreapp2.2/System.Dynamic.Runtime.dll", - "ref/netcoreapp2.2/System.Globalization.Calendars.dll", - "ref/netcoreapp2.2/System.Globalization.Extensions.dll", - "ref/netcoreapp2.2/System.Globalization.dll", - "ref/netcoreapp2.2/System.IO.Compression.Brotli.dll", - "ref/netcoreapp2.2/System.IO.Compression.FileSystem.dll", - "ref/netcoreapp2.2/System.IO.Compression.ZipFile.dll", - "ref/netcoreapp2.2/System.IO.Compression.ZipFile.xml", - "ref/netcoreapp2.2/System.IO.Compression.dll", - "ref/netcoreapp2.2/System.IO.Compression.xml", - "ref/netcoreapp2.2/System.IO.FileSystem.DriveInfo.dll", - "ref/netcoreapp2.2/System.IO.FileSystem.DriveInfo.xml", - "ref/netcoreapp2.2/System.IO.FileSystem.Primitives.dll", - "ref/netcoreapp2.2/System.IO.FileSystem.Watcher.dll", - "ref/netcoreapp2.2/System.IO.FileSystem.Watcher.xml", - "ref/netcoreapp2.2/System.IO.FileSystem.dll", - "ref/netcoreapp2.2/System.IO.FileSystem.xml", - "ref/netcoreapp2.2/System.IO.IsolatedStorage.dll", - "ref/netcoreapp2.2/System.IO.IsolatedStorage.xml", - "ref/netcoreapp2.2/System.IO.MemoryMappedFiles.dll", - "ref/netcoreapp2.2/System.IO.MemoryMappedFiles.xml", - "ref/netcoreapp2.2/System.IO.Pipes.dll", - "ref/netcoreapp2.2/System.IO.Pipes.xml", - "ref/netcoreapp2.2/System.IO.UnmanagedMemoryStream.dll", - "ref/netcoreapp2.2/System.IO.dll", - "ref/netcoreapp2.2/System.Linq.Expressions.dll", - "ref/netcoreapp2.2/System.Linq.Expressions.xml", - "ref/netcoreapp2.2/System.Linq.Parallel.dll", - "ref/netcoreapp2.2/System.Linq.Parallel.xml", - "ref/netcoreapp2.2/System.Linq.Queryable.dll", - "ref/netcoreapp2.2/System.Linq.Queryable.xml", - "ref/netcoreapp2.2/System.Linq.dll", - "ref/netcoreapp2.2/System.Linq.xml", - "ref/netcoreapp2.2/System.Memory.dll", - "ref/netcoreapp2.2/System.Memory.xml", - "ref/netcoreapp2.2/System.Net.Http.dll", - "ref/netcoreapp2.2/System.Net.Http.xml", - "ref/netcoreapp2.2/System.Net.HttpListener.dll", - "ref/netcoreapp2.2/System.Net.HttpListener.xml", - "ref/netcoreapp2.2/System.Net.Mail.dll", - "ref/netcoreapp2.2/System.Net.Mail.xml", - "ref/netcoreapp2.2/System.Net.NameResolution.dll", - "ref/netcoreapp2.2/System.Net.NameResolution.xml", - "ref/netcoreapp2.2/System.Net.NetworkInformation.dll", - "ref/netcoreapp2.2/System.Net.NetworkInformation.xml", - "ref/netcoreapp2.2/System.Net.Ping.dll", - "ref/netcoreapp2.2/System.Net.Ping.xml", - "ref/netcoreapp2.2/System.Net.Primitives.dll", - "ref/netcoreapp2.2/System.Net.Primitives.xml", - "ref/netcoreapp2.2/System.Net.Requests.dll", - "ref/netcoreapp2.2/System.Net.Requests.xml", - "ref/netcoreapp2.2/System.Net.Security.dll", - "ref/netcoreapp2.2/System.Net.Security.xml", - "ref/netcoreapp2.2/System.Net.ServicePoint.dll", - "ref/netcoreapp2.2/System.Net.ServicePoint.xml", - "ref/netcoreapp2.2/System.Net.Sockets.dll", - "ref/netcoreapp2.2/System.Net.Sockets.xml", - "ref/netcoreapp2.2/System.Net.WebClient.dll", - "ref/netcoreapp2.2/System.Net.WebClient.xml", - "ref/netcoreapp2.2/System.Net.WebHeaderCollection.dll", - "ref/netcoreapp2.2/System.Net.WebHeaderCollection.xml", - "ref/netcoreapp2.2/System.Net.WebProxy.dll", - "ref/netcoreapp2.2/System.Net.WebProxy.xml", - "ref/netcoreapp2.2/System.Net.WebSockets.Client.dll", - "ref/netcoreapp2.2/System.Net.WebSockets.Client.xml", - "ref/netcoreapp2.2/System.Net.WebSockets.dll", - "ref/netcoreapp2.2/System.Net.WebSockets.xml", - "ref/netcoreapp2.2/System.Net.dll", - "ref/netcoreapp2.2/System.Numerics.Vectors.dll", - "ref/netcoreapp2.2/System.Numerics.Vectors.xml", - "ref/netcoreapp2.2/System.Numerics.dll", - "ref/netcoreapp2.2/System.ObjectModel.dll", - "ref/netcoreapp2.2/System.ObjectModel.xml", - "ref/netcoreapp2.2/System.Reflection.DispatchProxy.dll", - "ref/netcoreapp2.2/System.Reflection.DispatchProxy.xml", - "ref/netcoreapp2.2/System.Reflection.Emit.ILGeneration.dll", - "ref/netcoreapp2.2/System.Reflection.Emit.ILGeneration.xml", - "ref/netcoreapp2.2/System.Reflection.Emit.Lightweight.dll", - "ref/netcoreapp2.2/System.Reflection.Emit.Lightweight.xml", - "ref/netcoreapp2.2/System.Reflection.Emit.dll", - "ref/netcoreapp2.2/System.Reflection.Emit.xml", - "ref/netcoreapp2.2/System.Reflection.Extensions.dll", - "ref/netcoreapp2.2/System.Reflection.Metadata.dll", - "ref/netcoreapp2.2/System.Reflection.Metadata.xml", - "ref/netcoreapp2.2/System.Reflection.Primitives.dll", - "ref/netcoreapp2.2/System.Reflection.Primitives.xml", - "ref/netcoreapp2.2/System.Reflection.TypeExtensions.dll", - "ref/netcoreapp2.2/System.Reflection.TypeExtensions.xml", - "ref/netcoreapp2.2/System.Reflection.dll", - "ref/netcoreapp2.2/System.Resources.Reader.dll", - "ref/netcoreapp2.2/System.Resources.ResourceManager.dll", - "ref/netcoreapp2.2/System.Resources.ResourceManager.xml", - "ref/netcoreapp2.2/System.Resources.Writer.dll", - "ref/netcoreapp2.2/System.Resources.Writer.xml", - "ref/netcoreapp2.2/System.Runtime.CompilerServices.VisualC.dll", - "ref/netcoreapp2.2/System.Runtime.CompilerServices.VisualC.xml", - "ref/netcoreapp2.2/System.Runtime.Extensions.dll", - "ref/netcoreapp2.2/System.Runtime.Extensions.xml", - "ref/netcoreapp2.2/System.Runtime.Handles.dll", - "ref/netcoreapp2.2/System.Runtime.InteropServices.RuntimeInformation.dll", - "ref/netcoreapp2.2/System.Runtime.InteropServices.RuntimeInformation.xml", - "ref/netcoreapp2.2/System.Runtime.InteropServices.WindowsRuntime.dll", - "ref/netcoreapp2.2/System.Runtime.InteropServices.WindowsRuntime.xml", - "ref/netcoreapp2.2/System.Runtime.InteropServices.dll", - "ref/netcoreapp2.2/System.Runtime.InteropServices.xml", - "ref/netcoreapp2.2/System.Runtime.Loader.dll", - "ref/netcoreapp2.2/System.Runtime.Loader.xml", - "ref/netcoreapp2.2/System.Runtime.Numerics.dll", - "ref/netcoreapp2.2/System.Runtime.Numerics.xml", - "ref/netcoreapp2.2/System.Runtime.Serialization.Formatters.dll", - "ref/netcoreapp2.2/System.Runtime.Serialization.Formatters.xml", - "ref/netcoreapp2.2/System.Runtime.Serialization.Json.dll", - "ref/netcoreapp2.2/System.Runtime.Serialization.Json.xml", - "ref/netcoreapp2.2/System.Runtime.Serialization.Primitives.dll", - "ref/netcoreapp2.2/System.Runtime.Serialization.Primitives.xml", - "ref/netcoreapp2.2/System.Runtime.Serialization.Xml.dll", - "ref/netcoreapp2.2/System.Runtime.Serialization.Xml.xml", - "ref/netcoreapp2.2/System.Runtime.Serialization.dll", - "ref/netcoreapp2.2/System.Runtime.dll", - "ref/netcoreapp2.2/System.Runtime.xml", - "ref/netcoreapp2.2/System.Security.Claims.dll", - "ref/netcoreapp2.2/System.Security.Claims.xml", - "ref/netcoreapp2.2/System.Security.Cryptography.Algorithms.dll", - "ref/netcoreapp2.2/System.Security.Cryptography.Algorithms.xml", - "ref/netcoreapp2.2/System.Security.Cryptography.Csp.dll", - "ref/netcoreapp2.2/System.Security.Cryptography.Csp.xml", - "ref/netcoreapp2.2/System.Security.Cryptography.Encoding.dll", - "ref/netcoreapp2.2/System.Security.Cryptography.Encoding.xml", - "ref/netcoreapp2.2/System.Security.Cryptography.Primitives.dll", - "ref/netcoreapp2.2/System.Security.Cryptography.Primitives.xml", - "ref/netcoreapp2.2/System.Security.Cryptography.X509Certificates.dll", - "ref/netcoreapp2.2/System.Security.Cryptography.X509Certificates.xml", - "ref/netcoreapp2.2/System.Security.Principal.dll", - "ref/netcoreapp2.2/System.Security.Principal.xml", - "ref/netcoreapp2.2/System.Security.SecureString.dll", - "ref/netcoreapp2.2/System.Security.dll", - "ref/netcoreapp2.2/System.ServiceModel.Web.dll", - "ref/netcoreapp2.2/System.ServiceProcess.dll", - "ref/netcoreapp2.2/System.Text.Encoding.Extensions.dll", - "ref/netcoreapp2.2/System.Text.Encoding.Extensions.xml", - "ref/netcoreapp2.2/System.Text.Encoding.dll", - "ref/netcoreapp2.2/System.Text.RegularExpressions.dll", - "ref/netcoreapp2.2/System.Text.RegularExpressions.xml", - "ref/netcoreapp2.2/System.Threading.Overlapped.dll", - "ref/netcoreapp2.2/System.Threading.Overlapped.xml", - "ref/netcoreapp2.2/System.Threading.Tasks.Dataflow.dll", - "ref/netcoreapp2.2/System.Threading.Tasks.Dataflow.xml", - "ref/netcoreapp2.2/System.Threading.Tasks.Extensions.dll", - "ref/netcoreapp2.2/System.Threading.Tasks.Extensions.xml", - "ref/netcoreapp2.2/System.Threading.Tasks.Parallel.dll", - "ref/netcoreapp2.2/System.Threading.Tasks.Parallel.xml", - "ref/netcoreapp2.2/System.Threading.Tasks.dll", - "ref/netcoreapp2.2/System.Threading.Tasks.xml", - "ref/netcoreapp2.2/System.Threading.Thread.dll", - "ref/netcoreapp2.2/System.Threading.Thread.xml", - "ref/netcoreapp2.2/System.Threading.ThreadPool.dll", - "ref/netcoreapp2.2/System.Threading.ThreadPool.xml", - "ref/netcoreapp2.2/System.Threading.Timer.dll", - "ref/netcoreapp2.2/System.Threading.Timer.xml", - "ref/netcoreapp2.2/System.Threading.dll", - "ref/netcoreapp2.2/System.Threading.xml", - "ref/netcoreapp2.2/System.Transactions.Local.dll", - "ref/netcoreapp2.2/System.Transactions.Local.xml", - "ref/netcoreapp2.2/System.Transactions.dll", - "ref/netcoreapp2.2/System.ValueTuple.dll", - "ref/netcoreapp2.2/System.Web.HttpUtility.dll", - "ref/netcoreapp2.2/System.Web.HttpUtility.xml", - "ref/netcoreapp2.2/System.Web.dll", - "ref/netcoreapp2.2/System.Windows.dll", - "ref/netcoreapp2.2/System.Xml.Linq.dll", - "ref/netcoreapp2.2/System.Xml.ReaderWriter.dll", - "ref/netcoreapp2.2/System.Xml.ReaderWriter.xml", - "ref/netcoreapp2.2/System.Xml.Serialization.dll", - "ref/netcoreapp2.2/System.Xml.XDocument.dll", - "ref/netcoreapp2.2/System.Xml.XDocument.xml", - "ref/netcoreapp2.2/System.Xml.XPath.XDocument.dll", - "ref/netcoreapp2.2/System.Xml.XPath.XDocument.xml", - "ref/netcoreapp2.2/System.Xml.XPath.dll", - "ref/netcoreapp2.2/System.Xml.XPath.xml", - "ref/netcoreapp2.2/System.Xml.XmlDocument.dll", - "ref/netcoreapp2.2/System.Xml.XmlSerializer.dll", - "ref/netcoreapp2.2/System.Xml.XmlSerializer.xml", - "ref/netcoreapp2.2/System.Xml.dll", - "ref/netcoreapp2.2/System.dll", - "ref/netcoreapp2.2/WindowsBase.dll", - "ref/netcoreapp2.2/mscorlib.dll", - "ref/netcoreapp2.2/netstandard.dll", - "runtime.json" - ] - }, - "Microsoft.NETCore.DotNetAppHost/2.2.0": { - "sha512": "DrhaKInRKKvN6Ns2VNIlC7ZffLOp9THf8cO6X4fytPRJovJUbF49/zzx4WfgX9E44FMsw9hT8hrKiIqDSHvGvA==", - "type": "package", - "path": "microsoft.netcore.dotnetapphost/2.2.0", - "files": [ - ".nupkg.metadata", - ".signature.p7s", - "LICENSE.TXT", - "THIRD-PARTY-NOTICES.TXT", - "microsoft.netcore.dotnetapphost.2.2.0.nupkg.sha512", - "microsoft.netcore.dotnetapphost.nuspec", - "runtime.json" - ] - }, - "Microsoft.NETCore.DotNetHostPolicy/2.2.0": { - "sha512": "FJie7IoPZFaPgNDxhZGmDBQP/Bs5vPdfca/G2Wf9gd6LIvMYkZcibtmJwB4tcf4KXkaOYfIOo4Cl9sEPMsSzkw==", - "type": "package", - "path": "microsoft.netcore.dotnethostpolicy/2.2.0", - "files": [ - ".nupkg.metadata", - ".signature.p7s", - "LICENSE.TXT", - "THIRD-PARTY-NOTICES.TXT", - "microsoft.netcore.dotnethostpolicy.2.2.0.nupkg.sha512", - "microsoft.netcore.dotnethostpolicy.nuspec", - "runtime.json" - ] - }, - "Microsoft.NETCore.DotNetHostResolver/2.2.0": { - "sha512": "spDm3AJYmebthDNhzY17YLPtvbc+Y1lCLVeiIH1uLJ/hZaM+40pBiPefFR8J1u66Ndkqi8ipR2tEbqPnYnjRhw==", - "type": "package", - "path": "microsoft.netcore.dotnethostresolver/2.2.0", - "files": [ - ".nupkg.metadata", - ".signature.p7s", - "LICENSE.TXT", - "THIRD-PARTY-NOTICES.TXT", - "microsoft.netcore.dotnethostresolver.2.2.0.nupkg.sha512", - "microsoft.netcore.dotnethostresolver.nuspec", - "runtime.json" - ] - }, - "Microsoft.NETCore.Platforms/2.2.0": { - "sha512": "T/J+XZo+YheFTJh8/4uoeJDdz5qOmOMkjg6/VL8mHJ9AnP8+fmV/kcbxeXsob0irRNiChf+V0ig1MCRLp/+Kog==", - "type": "package", - "path": "microsoft.netcore.platforms/2.2.0", - "files": [ - ".nupkg.metadata", - ".signature.p7s", - "LICENSE.TXT", - "THIRD-PARTY-NOTICES.TXT", - "lib/netstandard1.0/_._", - "microsoft.netcore.platforms.2.2.0.nupkg.sha512", - "microsoft.netcore.platforms.nuspec", - "runtime.json", - "useSharedDesignerContext.txt", - "version.txt" - ] - }, - "Microsoft.NETCore.Targets/2.0.0": { - "sha512": "odP/tJj1z6GylFpNo7pMtbd/xQgTC3Ex2If63dRTL38bBNMwsBnJ+RceUIyHdRBC0oik/3NehYT+oECwBhIM3Q==", - "type": "package", - "path": "microsoft.netcore.targets/2.0.0", - "files": [ - ".nupkg.metadata", - "LICENSE.TXT", - "THIRD-PARTY-NOTICES.TXT", - "lib/netstandard1.0/_._", - "microsoft.netcore.targets.2.0.0.nupkg.sha512", - "microsoft.netcore.targets.nuspec", - "runtime.json", - "useSharedDesignerContext.txt", - "version.txt" - ] - }, - "NETStandard.Library/2.0.3": { - "sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "type": "package", - "path": "netstandard.library/2.0.3", - "files": [ - ".nupkg.metadata", - "LICENSE.TXT", - "THIRD-PARTY-NOTICES.TXT", - "build/netstandard2.0/NETStandard.Library.targets", - "build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll", - "build/netstandard2.0/ref/System.AppContext.dll", - "build/netstandard2.0/ref/System.Collections.Concurrent.dll", - "build/netstandard2.0/ref/System.Collections.NonGeneric.dll", - "build/netstandard2.0/ref/System.Collections.Specialized.dll", - "build/netstandard2.0/ref/System.Collections.dll", - "build/netstandard2.0/ref/System.ComponentModel.Composition.dll", - "build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll", - "build/netstandard2.0/ref/System.ComponentModel.Primitives.dll", - "build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll", - "build/netstandard2.0/ref/System.ComponentModel.dll", - "build/netstandard2.0/ref/System.Console.dll", - "build/netstandard2.0/ref/System.Core.dll", - "build/netstandard2.0/ref/System.Data.Common.dll", - "build/netstandard2.0/ref/System.Data.dll", - "build/netstandard2.0/ref/System.Diagnostics.Contracts.dll", - "build/netstandard2.0/ref/System.Diagnostics.Debug.dll", - "build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll", - "build/netstandard2.0/ref/System.Diagnostics.Process.dll", - "build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll", - "build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll", - "build/netstandard2.0/ref/System.Diagnostics.Tools.dll", - "build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll", - "build/netstandard2.0/ref/System.Diagnostics.Tracing.dll", - "build/netstandard2.0/ref/System.Drawing.Primitives.dll", - "build/netstandard2.0/ref/System.Drawing.dll", - "build/netstandard2.0/ref/System.Dynamic.Runtime.dll", - "build/netstandard2.0/ref/System.Globalization.Calendars.dll", - "build/netstandard2.0/ref/System.Globalization.Extensions.dll", - "build/netstandard2.0/ref/System.Globalization.dll", - "build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll", - "build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll", - "build/netstandard2.0/ref/System.IO.Compression.dll", - "build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll", - "build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll", - "build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll", - "build/netstandard2.0/ref/System.IO.FileSystem.dll", - "build/netstandard2.0/ref/System.IO.IsolatedStorage.dll", - "build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll", - "build/netstandard2.0/ref/System.IO.Pipes.dll", - "build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll", - "build/netstandard2.0/ref/System.IO.dll", - "build/netstandard2.0/ref/System.Linq.Expressions.dll", - "build/netstandard2.0/ref/System.Linq.Parallel.dll", - "build/netstandard2.0/ref/System.Linq.Queryable.dll", - "build/netstandard2.0/ref/System.Linq.dll", - "build/netstandard2.0/ref/System.Net.Http.dll", - "build/netstandard2.0/ref/System.Net.NameResolution.dll", - "build/netstandard2.0/ref/System.Net.NetworkInformation.dll", - "build/netstandard2.0/ref/System.Net.Ping.dll", - "build/netstandard2.0/ref/System.Net.Primitives.dll", - "build/netstandard2.0/ref/System.Net.Requests.dll", - "build/netstandard2.0/ref/System.Net.Security.dll", - "build/netstandard2.0/ref/System.Net.Sockets.dll", - "build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll", - "build/netstandard2.0/ref/System.Net.WebSockets.Client.dll", - "build/netstandard2.0/ref/System.Net.WebSockets.dll", - "build/netstandard2.0/ref/System.Net.dll", - "build/netstandard2.0/ref/System.Numerics.dll", - "build/netstandard2.0/ref/System.ObjectModel.dll", - "build/netstandard2.0/ref/System.Reflection.Extensions.dll", - "build/netstandard2.0/ref/System.Reflection.Primitives.dll", - "build/netstandard2.0/ref/System.Reflection.dll", - "build/netstandard2.0/ref/System.Resources.Reader.dll", - "build/netstandard2.0/ref/System.Resources.ResourceManager.dll", - "build/netstandard2.0/ref/System.Resources.Writer.dll", - "build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll", - "build/netstandard2.0/ref/System.Runtime.Extensions.dll", - "build/netstandard2.0/ref/System.Runtime.Handles.dll", - "build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll", - "build/netstandard2.0/ref/System.Runtime.InteropServices.dll", - "build/netstandard2.0/ref/System.Runtime.Numerics.dll", - "build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll", - "build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll", - "build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll", - "build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll", - "build/netstandard2.0/ref/System.Runtime.Serialization.dll", - "build/netstandard2.0/ref/System.Runtime.dll", - "build/netstandard2.0/ref/System.Security.Claims.dll", - "build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll", - "build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll", - "build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll", - "build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll", - "build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll", - "build/netstandard2.0/ref/System.Security.Principal.dll", - "build/netstandard2.0/ref/System.Security.SecureString.dll", - "build/netstandard2.0/ref/System.ServiceModel.Web.dll", - "build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll", - "build/netstandard2.0/ref/System.Text.Encoding.dll", - "build/netstandard2.0/ref/System.Text.RegularExpressions.dll", - "build/netstandard2.0/ref/System.Threading.Overlapped.dll", - "build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll", - "build/netstandard2.0/ref/System.Threading.Tasks.dll", - "build/netstandard2.0/ref/System.Threading.Thread.dll", - "build/netstandard2.0/ref/System.Threading.ThreadPool.dll", - "build/netstandard2.0/ref/System.Threading.Timer.dll", - "build/netstandard2.0/ref/System.Threading.dll", - "build/netstandard2.0/ref/System.Transactions.dll", - "build/netstandard2.0/ref/System.ValueTuple.dll", - "build/netstandard2.0/ref/System.Web.dll", - "build/netstandard2.0/ref/System.Windows.dll", - "build/netstandard2.0/ref/System.Xml.Linq.dll", - "build/netstandard2.0/ref/System.Xml.ReaderWriter.dll", - "build/netstandard2.0/ref/System.Xml.Serialization.dll", - "build/netstandard2.0/ref/System.Xml.XDocument.dll", - "build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll", - "build/netstandard2.0/ref/System.Xml.XPath.dll", - "build/netstandard2.0/ref/System.Xml.XmlDocument.dll", - "build/netstandard2.0/ref/System.Xml.XmlSerializer.dll", - "build/netstandard2.0/ref/System.Xml.dll", - "build/netstandard2.0/ref/System.dll", - "build/netstandard2.0/ref/mscorlib.dll", - "build/netstandard2.0/ref/netstandard.dll", - "build/netstandard2.0/ref/netstandard.xml", - "lib/netstandard1.0/_._", - "netstandard.library.2.0.3.nupkg.sha512", - "netstandard.library.nuspec" - ] - } - }, - "projectFileDependencyGroups": { - ".NETCoreApp,Version=v2.2": [ - "Microsoft.NETCore.App >= 2.2.0" - ] - }, - "packageFolders": { - "/Users/ben/.nuget/packages/": {}, - "/usr/local/share/dotnet/sdk/NuGetFallbackFolder": {} - }, - "project": { - "version": "1.0.0", - "restore": { - "projectUniqueName": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/csharp.csproj", - "projectName": "csharp", - "projectPath": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/csharp.csproj", - "packagesPath": "/Users/ben/.nuget/packages/", - "outputPath": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/obj/", - "projectStyle": "PackageReference", - "fallbackFolders": [ - "/usr/local/share/dotnet/sdk/NuGetFallbackFolder" - ], - "configFilePaths": [ - "/Users/ben/.nuget/NuGet/NuGet.Config" - ], - "originalTargetFrameworks": [ - "netcoreapp2.2" - ], - "sources": { - "https://api.nuget.org/v3/index.json": {} - }, - "frameworks": { - "netcoreapp2.2": { - "projectReferences": {} - } - }, - "warningProperties": { - "warnAsError": [ - "NU1605" - ] - } - }, - "frameworks": { - "netcoreapp2.2": { - "dependencies": { - "Microsoft.NETCore.App": { - "suppressParent": "All", - "target": "Package", - "version": "[2.2.0, )", - "autoReferenced": true - } - }, - "imports": [ - "net461", - "net462", - "net47", - "net471", - "net472", - "net48" - ], - "assetTargetFallback": true, - "warn": true, - "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/3.1.402/RuntimeIdentifierGraph.json" - } - } - } -} \ No newline at end of file From f389d65a24e02137b62c939264ffeb37952c522a Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 15 Apr 2021 19:12:24 +0100 Subject: [PATCH 15/47] Add a test for csharp, run in CI --- .github/workflows/build.yaml | 5 +++ run_tests | 8 +++- support/test/csharp/.vimspector.json | 4 +- support/test/csharp/csharp.sln | 16 +++++++ tests/ci/image/Dockerfile | 6 +++ tests/language_csharp.test.vim | 65 ++++++++++++++++++++++++++++ 6 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 tests/language_csharp.test.vim diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 17f9601..f4ec9bf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -111,6 +111,11 @@ jobs: path: gadgets/macos/download name: Cache gadgets + - name: 'Install .NET Core SDK 3.1' + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: 3.1 + - run: vim --version name: 'Print vim version information' diff --git a/run_tests b/run_tests index 39dc7ec..441acb0 100755 --- a/run_tests +++ b/run_tests @@ -91,7 +91,8 @@ if [ "$INSTALL" = "1" ] || [ "$INSTALL" = "script" ]; then if ! python3 $(dirname $0)/install_gadget.py \ --basedir ${BASEDIR} \ ${INSTALLER_ARGS} \ - --all; then + --all \ + --force-enable-csharp; then echo "Script installation reported errors" >&2 exit 1 fi @@ -102,7 +103,7 @@ if [ "$INSTALL" = "1" ] || [ "$INSTALL" = "vim" ]; then --cmd "${BASEDIR_CMD}" \ -c 'autocmd User VimspectorInstallSuccess qa!' \ -c 'autocmd User VimspectorInstallFailed cquit!' \ - -c "VimspectorInstall --all"; then + -c "VimspectorInstall --all netcoredbg"; then echo "Vim installation reported errors" >&2 exit 1 fi @@ -144,6 +145,9 @@ set -e pushd tests/testdata/cpp/simple make clean all popd + pushd support/test/csharp + dotnet build + popd set +e echo "%DONE - built test programs" diff --git a/support/test/csharp/.vimspector.json b/support/test/csharp/.vimspector.json index 3bfb0f3..326739b 100644 --- a/support/test/csharp/.vimspector.json +++ b/support/test/csharp/.vimspector.json @@ -29,7 +29,7 @@ "request": "launch", "program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll", "args": [], - "stopAtEntry": true + "stopAtEntry": false } }, "launch - netcoredbg - with debug log": { @@ -38,7 +38,7 @@ "request": "launch", "program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/csharp.dll", "args": [], - "stopAtEntry": true + "stopAtEntry": false } }, "launch - mono": { diff --git a/support/test/csharp/csharp.sln b/support/test/csharp/csharp.sln index bba50e0..91f59bf 100644 --- a/support/test/csharp/csharp.sln +++ b/support/test/csharp/csharp.sln @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csharp", "csharp.csproj", "{91DB205F-E422-430B-BBB8-955110C7B3B6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,4 +17,18 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x64.ActiveCfg = Debug|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x64.Build.0 = Debug|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x86.ActiveCfg = Debug|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Debug|x86.Build.0 = Debug|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|Any CPU.Build.0 = Release|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x64.ActiveCfg = Release|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x64.Build.0 = Release|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x86.ActiveCfg = Release|Any CPU + {91DB205F-E422-430B-BBB8-955110C7B3B6}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection EndGlobal diff --git a/tests/ci/image/Dockerfile b/tests/ci/image/Dockerfile index a25febc..164a5a7 100644 --- a/tests/ci/image/Dockerfile +++ b/tests/ci/image/Dockerfile @@ -70,6 +70,12 @@ RUN mkdir -p /home/linuxbrew/.linuxbrew &&\ RUN /home/linuxbrew/.linuxbrew/bin/brew install golang +# dotnet +RUN curl -sSL https://dot.net/v1/dotnet-install.sh \ + | bash /dev/stdin --channel LTS --install-dir /usr/share/dotnet && \ + update-alternatives --install /usr/bin/dotnet dotnet \ + /usr/share/dotnet/dotnet 1 + # clean up RUN /home/linuxbrew/.linuxbrew/bin/brew cleanup && \ rm -rf ~/.cache && \ diff --git a/tests/language_csharp.test.vim b/tests/language_csharp.test.vim new file mode 100644 index 0000000..64cf954 --- /dev/null +++ b/tests/language_csharp.test.vim @@ -0,0 +1,65 @@ +function! SetUp() + call vimspector#test#setup#SetUpWithMappings( v:none ) +endfunction + +function! ClearDown() + call vimspector#test#setup#ClearDown() +endfunction + +function! SetUp_Test_Go_Simple() + let g:vimspector_enable_mappings = 'HUMAN' +endfunction + +function! Test_CSharp_Simple() + let fn='Program.cs' + lcd ../support/test/csharp + exe 'edit ' . fn + + call vimspector#SetLineBreakpoint( fn, 31 ) + call vimspector#LaunchWithSettings( { + \ 'configuration': 'launch - netcoredbg' + \ } ) + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 31, 7 ) + call WaitForAssert( {-> + \ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 31 ) + \ } ) + + call vimspector#StepOver() + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 32, 12 ) + call WaitForAssert( {-> + \ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 32 ) + \ } ) + + call vimspector#test#setup#Reset() + + lcd - + %bwipeout! +endfunction + + +function! Test_Run_To_Cursor() + let fn='Program.cs' + lcd ../support/test/csharp + exe 'edit ' . fn + + call vimspector#SetLineBreakpoint( fn, 31 ) + call vimspector#LaunchWithSettings( { + \ 'configuration': 'launch - netcoredbg' + \ } ) + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 31, 7 ) + call WaitForAssert( {-> + \ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 31 ) + \ } ) + + call cursor( 33, 1 ) + call vimspector#RunToCursor() + call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 33, 1 ) + call WaitForAssert( {-> + \ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 33 ) + \ } ) + + call vimspector#test#setup#Reset() + lcd - + %bwipeout! +endfunction + From bc15c9451375909c6a52cf98c9d2ce8d2a834f41 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 15 Apr 2021 21:39:38 +0100 Subject: [PATCH 16/47] Retire mono debug - never worked and seems abandoned, and vscode-python as it is serious legacy now --- README.md | 102 ++++++---------------------------- python3/vimspector/gadgets.py | 58 ------------------- 2 files changed, 18 insertions(+), 142 deletions(-) diff --git a/README.md b/README.md index ae0ef46..5e05500 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,6 @@ For detailed explanatin of the `.vimspector.json` format, see the * [Python](#python) * [Python Remote Debugging](#python-remote-debugging) * [Python Remote launch and attach](#python-remote-launch-and-attach) - * [Legacy: vscode-python](#legacy-vscode-python) * [TCL](#tcl) * [C♯](#c) * [Go](#go) @@ -145,23 +144,24 @@ runtime dependencies). They are categorised by their level of support: * `Supported` : Fully supported, frequently used and manually tested * `Experimental`: Working, but not frequently used and rarely tested * `Legacy`: No longer supported, please migrate your config +* `Retired`: No longer included or supported. -| Language | Status | Switch (for `install_gadget.py`) | Adapter (for `:VimspectorInstall`) | Dependencies | -|--------------------|--------------|------------------------------------|------------------------------------|--------------------------------------------| -| C, C++, Rust etc. | Tested | `--all` or `--enable-c` (or cpp) | vscode-cpptools | mono-core | -| Rust, C, C++, etc. | Supported | `--force-enable-rust` | CodeLLDB | Python 3 | -| Python | Tested | `--all` or `--enable-python` | debugpy | Python 2.7 or Python 3 | -| Go | Tested | `--enable-go` | vscode-go | Node, Go, [Delve][] | -| TCL | Supported | `--all` or `--enable-tcl` | tclpro | TCL 8.5 | -| Bourne Shell | Supported | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? | -| Lua | Supported | `--all` or `--enable-lua` | local-lua-debugger-vscode | Node >=12.13.0, Npm, Lua interpreter | -| Node.js | Supported | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm | -| Javascript | Supported | `--force-enable-chrome` | debugger-for-chrome | Chrome | -| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) | -| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core | -| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono | -| F#, VB, etc. | Experimental | `--force-enable-fsharp` (or vbnet) | netcoredbg | DotNet core | -| Python.legacy | Legacy | `--force-enable-python.legacy` | vscode-python | Node 10, Python 2.7 or Python 3 | +| Language | Status | Switch (for `install_gadget.py`) | Adapter (for `:VimspectorInstall`) | Dependencies | +|--------------------|-----------|----------------------------------|------------------------------------|--------------------------------------------| +| C, C++, Rust etc. | Tested | `--all` or `--enable-c` (or cpp) | vscode-cpptools | mono-core | +| Rust, C, C++, etc. | Supported | `--force-enable-rust` | CodeLLDB | Python 3 | +| Python | Tested | `--all` or `--enable-python` | debugpy | Python 2.7 or Python 3 | +| Go | Tested | `--enable-go` | vscode-go | Node, Go, [Delve][] | +| TCL | Supported | `--all` or `--enable-tcl` | tclpro | TCL 8.5 | +| Bourne Shell | Supported | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? | +| Lua | Supported | `--all` or `--enable-lua` | local-lua-debugger-vscode | Node >=12.13.0, Npm, Lua interpreter | +| Node.js | Supported | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm | +| Javascript | Supported | `--force-enable-chrome` | debugger-for-chrome | Chrome | +| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) | +| C# (dotnet core) | Tested | `--force-enable-csharp` | netcoredbg | DotNet core | +| F#, VB, etc. | Supported | `--force-enable-[fsharp,vbnet]` | `, `--force-enable-vbnet` | netcoredbg | DotNet core | +| C# (mono) | _Retired_ | N/A | N/A | N/A | +| Python.legacy | _Retired_ | N/A | N/A | N/A | ## Other languages @@ -526,13 +526,6 @@ Example: "${gadgetDir}/vscode-cpptools/debugAdapters/OpenDebugAD7" ], "name": "cppdbg" - }, - "vscode-python": { - "command": [ - "node", - "${gadgetDir}/vscode-python/out/client/debugger/debugAdapter/main.js" - ], - "name": "vscode-python" } } } @@ -1264,10 +1257,6 @@ Rust is supported with any gdb/lldb-based debugger. So it works fine with headers/libs to build a C python extension for performance. * Full options: https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings - -**Migrating from `vscode-python`**: change `"adapter": "vscode-python"` to -`"adapter": "debugpy"`. - ```json { "configurations": { @@ -1334,34 +1323,6 @@ debugpy](https://github.com/microsoft/debugpy/wiki/Debugging-over-SSH). If you're feeling fancy, checkout the [reference guide][remote-debugging] for an example of getting Vimspector to remotely launch and attach. -### Legacy: vscode-python - -* No longer installed by default - please pass `--force-enable-python.legacy` if - you just want to continue using your working setup. -* [vscode-python](https://github.com/Microsoft/vscode-python) -* NOTE: You must be running `node` 10. See [this issue](https://github.com/puremourning/vimspector/issues/105) - -```json -{ - "configurations": { - ": Launch": { - "adapter": "vscode-python", - "configuration": { - "name": ": Launch", - "type": "python", - "request": "launch", - "cwd": "", - "stopOnEntry": true, - "console": "externalTerminal", - "debugOptions": [], - "program": "" - } - } - ... - } -} -``` - ## TCL * TCL (TclProDebug) @@ -1385,35 +1346,8 @@ netcoredbg` "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", "args": [], "stopAtEntry": true, - "cwd": "${workspaceRoot}" - } - } - } -} -``` - -* C# - mono - -Install with `install_gadget.py --force-enable-csharp` or `:VimspectorInstall -vscode-mono-debug`. - -***Known not to work.*** - -```json -{ - "configurations": { - "launch - mono": { - "adapter": "vscode-mono-debug", - "configuration": { - "request": "launch", - "program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/csharp.dll", - "args": [], "cwd": "${workspaceRoot}", - "runtimeExecutable": "mono", - "runtimeArgs": [], - "env": [], - "externalConsole": false, - "console": "integratedTerminal" + "env": {} } } } diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 6b28095..2c60a1a 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -86,29 +86,6 @@ GADGETS = { }, }, }, - 'vscode-python': { - 'language': 'python.legacy', - 'enabled': False, - 'download': { - 'url': 'https://github.com/Microsoft/vscode-python/releases/download/' - '${version}/${file_name}', - }, - 'all': { - 'version': '2019.11.50794', - 'file_name': 'ms-python-release.vsix', - 'checksum': - '6a9edf9ecabed14aac424e6007858068204a3638bf3bb4f235bd6035d823acc6', - }, - 'adapters': { - "vscode-python": { - "name": "vscode-python", - "command": [ - "node", - "${gadgetDir}/vscode-python/out/client/debugger/debugAdapter/main.js", - ], - } - }, - }, 'debugpy': { 'language': 'python', 'download': { @@ -269,41 +246,6 @@ GADGETS = { }, } }, - 'vscode-mono-debug': { - 'language': 'csharp', - 'enabled': False, - 'download': { - 'url': 'https://marketplace.visualstudio.com/_apis/public/gallery/' - 'publishers/ms-vscode/vsextensions/mono-debug/${version}/' - 'vspackage', - 'target': 'vscode-mono-debug.vsix.gz', - 'format': 'zip.gz', - }, - 'all': { - 'file_name': 'vscode-mono-debug.vsix', - 'version': '0.16.2', - 'checksum': - '121eca297d83daeeb1e6e1d791305d1827998dbd595c330086b3b94d33dba3b9', - }, - 'adapters': { - 'vscode-mono-debug': { - "name": "mono-debug", - "command": [ - "mono", - "${gadgetDir}/vscode-mono-debug/bin/Release/mono-debug.exe" - ], - "attach": { - "pidSelect": "none" - }, - "configuration": { - "cwd": "${workspaceRoot}", - "console": "integratedTerminal", - "args": [], - "env": {} - } - }, - } - }, 'vscode-bash-debug': { 'language': 'bash', 'download': { From 1e25313cb5efc014b66a79d84d5c92c9bded6ebf Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 15 Apr 2021 22:52:58 +0100 Subject: [PATCH 17/47] Switch to xcode 11 which apparently works with coreclr debugging https://github.com/dotnet/runtime/issues/42311#issuecomment-700718025 --- .github/workflows/build.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f4ec9bf..14f5979 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -116,6 +116,11 @@ jobs: with: dotnet-version: 3.1 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ^11 + name: "Switch to xcode 11 because of .NET debugging bug" + - run: vim --version name: 'Print vim version information' @@ -148,7 +153,7 @@ jobs: # if: failure() # with: # NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - # SSH_PASS: ${{ secrets.SSH_PASS }} + # SSH_PASS: ${{ secrets.SSH_PASS }} # [V]imspector PublishRelease: runs-on: 'ubuntu-16.04' From 297c0bea56fd3afce5209f47f330880d759c8698 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 20 Apr 2021 20:52:47 +0100 Subject: [PATCH 18/47] Ensure linux tests pass on PR --- .mergify.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index 09d3d83..0f02002 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -9,9 +9,8 @@ pull_request_rules: # CI https://doc.mergify.io/conditions.html#github-actions - status-success=PythonLint - status-success=VimscriptLint + - status-success=Linux - status-success=MacOS - - actions: &merge-actions merge: method: merge From 026ac22280cc19b7dd7bb3f976968264b6b15aab Mon Sep 17 00:00:00 2001 From: Jade Date: Thu, 22 Apr 2021 03:33:02 -0700 Subject: [PATCH 19/47] Fix some typos in the readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e05500..e3a5ad5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ For a tutorial and usage overview, take a look at the [Vimspector website][website]. -For detailed explanatin of the `.vimspector.json` format, see the +For detailed explanation of the `.vimspector.json` format, see the [reference guide][vimspector-ref]. ![Build](https://github.com/puremourning/vimspector/workflows/Build/badge.svg?branch=master) [![Gitter](https://badges.gitter.im/vimspector/Lobby.svg)](https://gitter.im/vimspector/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) @@ -99,7 +99,7 @@ For detailed explanatin of the `.vimspector.json` format, see the # Features and Usage The plugin is a capable Vim graphical debugger for multiple languages. -It's mostly tested for c++, python and TCL, but in theory supports any +It's mostly tested for C++, Python and TCL, but in theory supports any language that Visual Studio Code supports (but see caveats). The [Vimspector website][website] has an overview of the UI, along with basic From 0c88cc8badeeee74f9cafbf461b72769b06a15d5 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 29 Apr 2021 10:02:23 +0100 Subject: [PATCH 20/47] Fix traceback when opening popup in neovim with log visible * We enter the popup window * some log data is received, so we update the log buffer and jump to the log window to scroll it * meanwhile, the WinLeave auto command on the popup window fires and closes the popup window * Having scrolled the log window, we try to jump back to the popup window, which by now has been closed. Fixes #390 --- autoload/vimspector/internal/neojob.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/autoload/vimspector/internal/neojob.vim b/autoload/vimspector/internal/neojob.vim index 0cefc63..a398afe 100644 --- a/autoload/vimspector/internal/neojob.vim +++ b/autoload/vimspector/internal/neojob.vim @@ -159,15 +159,16 @@ function! s:_OnCommandEvent( category, id, data, event ) abort call setbufvar( buffer, '&modified', 0 ) endtry - " if the buffer is visible, scroll it + " if the buffer is visible, scroll it, but don't allow autocommands to fire, + " as this may close the current window! let w = bufwinnr( buffer ) if w > 0 let cw = winnr() try - execute w . 'wincmd w' - normal! Gz- + noautocmd execute w . 'wincmd w' + noautocmd normal! Gz- finally - execute cw . 'wincmd w' + noautocmd execute cw . 'wincmd w' endtry endif elseif a:event ==# 'exit' From 2b844394133343a8868e7b4044ed286d5202fc99 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 3 May 2021 14:09:14 +0100 Subject: [PATCH 21/47] Lock closed issues after 60 days --- .github/workflows/lock_old_issues.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/lock_old_issues.yaml diff --git a/.github/workflows/lock_old_issues.yaml b/.github/workflows/lock_old_issues.yaml new file mode 100644 index 0000000..d9c3bca --- /dev/null +++ b/.github/workflows/lock_old_issues.yaml @@ -0,0 +1,26 @@ +name: "Lock Old Issues" + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v2 + with: + github-token: ${{ github.token }} + issue-lock-inactive-days: '60' + # issue-exclude-created-before: '' + # issue-exclude-labels: '' + # issue-lock-labels: '' + # issue-lock-comment: '' + # issue-lock-reason: 'resolved' + # pr-lock-inactive-days: '365' + # pr-exclude-created-before: '' + # pr-exclude-labels: '' + # pr-lock-labels: '' + # pr-lock-comment: '' + # pr-lock-reason: 'resolved' + process-only: 'issues' From a7e8e93920cbdf41eb9334b4998c0688a00b8ef8 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 3 May 2021 14:09:56 +0100 Subject: [PATCH 22/47] Allow manual running of locker --- .github/workflows/lock_old_issues.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lock_old_issues.yaml b/.github/workflows/lock_old_issues.yaml index d9c3bca..25d65e0 100644 --- a/.github/workflows/lock_old_issues.yaml +++ b/.github/workflows/lock_old_issues.yaml @@ -3,6 +3,7 @@ name: "Lock Old Issues" on: schedule: - cron: '0 0 * * *' + workflow_dispatch: jobs: lock: From 4e04a862cb37105acebac8b6ac5b275dc7865815 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 3 May 2021 15:02:50 +0100 Subject: [PATCH 23/47] Add note about existing github issues --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1866974..adec034 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,6 +46,23 @@ The GitHub issue tracker is for *bug reports* and *features requests* for the Vimspector project, and on-topic comments and follow-ups to them. It is not for general discussion, general support or for any other purpose. +Please **search the issue tracker for similar issues** before creating a new +one. There's no point in duplication; if an existing open issue addresses your +problem, please comment there instead of creating a duplicate. However, if the +issue you found is **closed as resolved** (e.g. with a PR or the original user's +problem was resolved), raise a **new issue**, because you've found a new +problem. Reference the original issue if you think that's useful information. + +Closed issues which have been inactive for 60 days will be locked, this helps to +keep discussions focussed. If you believe you are still experiencing an issue +which has been closed, please raise a new issue, completing the issue template. + +If you do find a similar _open_ issue, **don't just post 'me too' or similar** +responses. This almost never helps resolve the issue, and just causes noise for +the maintainers. Only post if it will aid the maintainers in solving the issue; +if there are existing diagnostics requested in the thread, perform +them and post the results. + Please do not be offended if your Issue or comment is closed or hidden, for any of the following reasons: @@ -53,6 +70,7 @@ of the following reasons: * The issue or comment is off-topic * The issue does not represent a Vimspector bug or feature request * The issue cannot be reasonably reproduced using the minimal vimrc +* The issue is a duplicate of an existing issue * etc. Issue titles are important. It's not usually helpful to write a title like From 08679d1c3ec46edb693e934a3a0f8326280e5893 Mon Sep 17 00:00:00 2001 From: przepompownia Date: Tue, 11 May 2021 00:55:35 +0200 Subject: [PATCH 24/47] Upgrade php-debug to v1.15.1 --- python3/vimspector/gadgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 2c60a1a..62321ae 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -323,10 +323,10 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.14.9', - 'file_name': 'php-debug.vsix', + 'version': 'v1.15.1', + 'file_name': 'php-debug-1.15.1.vsix', 'checksum': - '0c5709cbbffe26b12aa63a88142195a9a045a5d8fca7fe63d62c789fe601630d', + '10222655d4179c7d109b1f951d88034eba772b45bf6141dcdb4e9b4477d2e2ab', }, 'adapters': { 'vscode-php-debug': { From 9113dbb6989ff9e289a2d1b8d740774cc33ee024 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 4 May 2021 21:59:44 +0100 Subject: [PATCH 25/47] stack_trace: Add cursorline highlight and sign for current frame --- README.md | 42 +++++---- python3/vimspector/settings.py | 3 +- python3/vimspector/stack_trace.py | 41 +++++++-- .../cpp/simple_c_program/.ycm_extra_conf.py | 2 +- tests/stack_trace.test.vim | 89 +++++++++++++++++++ 5 files changed, 150 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index e3a5ad5..bf84d2f 100644 --- a/README.md +++ b/README.md @@ -1007,6 +1007,8 @@ be changed manually to "switch to" that thread. to set the "focussed" thread to the currently selected one. If the selected line is a stack frame, set the focussed thread to the thread of that frame and jump to that frame in the code window. +* The current frame when a breakpoint is hit or if manuall jumping is also + highlighted. ![stack trace](https://puremourning.github.io/vimspector-web/img/vimspector-callstack-window.png) @@ -1700,22 +1702,26 @@ Vimsector uses them, they will not be replaced. So to customise the signs, define them in your `vimrc`. -| Sign | Description | Priority | -|------------------------|-------------------------------------|----------| -| `vimspectorBP` | Line breakpoint | 9 | -| `vimspectorBPCond` | Conditional line breakpoint | 9 | -| `vimspectorBPDisabled` | Disabled breakpoint | 9 | -| `vimspectorPC` | Program counter (i.e. current line) | 200 | -| `vimspectorPCBP` | Program counter and breakpoint | 200 | +| Sign | Description | Priority | +|---------------------------|-----------------------------------------|----------| +| `vimspectorBP` | Line breakpoint | 9 | +| `vimspectorBPCond` | Conditional line breakpoint | 9 | +| `vimspectorBPDisabled` | Disabled breakpoint | 9 | +| `vimspectorPC` | Program counter (i.e. current line) | 200 | +| `vimspectorPCBP` | Program counter and breakpoint | 200 | +| `vimspectorCurrentThread` | Focussed thread in stack trace view | 200 | +| `vimspectorCurrentFrame` | Current stack frame in stack trace view | 200 | The default symbols are the equivalent of something like the following: ```viml -sign define vimspectorBP text=\ ● texthl=WarningMsg -sign define vimspectorBPCond text=\ ◆ texthl=WarningMsg -sign define vimspectorBPDisabled text=\ ● texthl=LineNr -sign define vimspectorPC text=\ ▶ texthl=MatchParen linehl=CursorLine -sign define vimspectorPCBP text=●▶ texthl=MatchParen linehl=CursorLine +sign define vimspectorBP text=\ ● texthl=WarningMsg +sign define vimspectorBPCond text=\ ◆ texthl=WarningMsg +sign define vimspectorBPDisabled text=\ ● texthl=LineNr +sign define vimspectorPC text=\ ▶ texthl=MatchParen linehl=CursorLine +sign define vimspectorPCBP text=●▶ texthl=MatchParen linehl=CursorLine +sign define vimspectorCurrentThread text=▶ texthl=MatchParen linehl=CursorLine +sign define vimspectorCurrentFrame text=▶ texthl=Special linehl=CursorLine ``` If the signs don't display properly, your font probably doesn't contain these @@ -1723,11 +1729,13 @@ glyphs. You can easily change them by defining the sign in your vimrc. For example, you could put this in your `vimrc` to use some simple ASCII symbols: ```viml -sign define vimspectorBP text=o texthl=WarningMsg -sign define vimspectorBPCond text=o? texthl=WarningMsg -sign define vimspectorBPDisabled text=o! texthl=LineNr -sign define vimspectorPC text=\ > texthl=MatchParen -sign define vimspectorPCBP text=o> texthl=MatchParen +sign define vimspectorBP text=o texthl=WarningMsg +sign define vimspectorBPCond text=o? texthl=WarningMsg +sign define vimspectorBPDisabled text=o! texthl=LineNr +sign define vimspectorPC text=\ > texthl=MatchParen +sign define vimspectorPCBP text=o> texthl=MatchParen +sign define vimspectorCurrentThread text=> texthl=MatchParen +sign define vimspectorCurrentFrame text=> texthl=Special ``` ## Sign priority diff --git a/python3/vimspector/settings.py b/python3/vimspector/settings.py index a060543..89378af 100644 --- a/python3/vimspector/settings.py +++ b/python3/vimspector/settings.py @@ -42,7 +42,8 @@ DEFAULTS = { 'vimspectorBP': 9, 'vimspectorBPCond': 9, 'vimspectorBPDisabled': 9, - 'vimspectorCurrentThread': 200 + 'vimspectorCurrentThread': 200, + 'vimspectorCurrentFrame': 200, }, # Installer diff --git a/python3/vimspector/stack_trace.py b/python3/vimspector/stack_trace.py index ae14e68..f9540ba 100644 --- a/python3/vimspector/stack_trace.py +++ b/python3/vimspector/stack_trace.py @@ -102,7 +102,8 @@ class StackTraceView( object ): self._scratch_buffers = [] # FIXME: This ID is by group, so should be module scope - self._next_sign_id = 1 + self._current_thread_sign_id = 0 # 1 when used + self._current_frame_sign_id = 0 # 2 when used utils.SetUpHiddenBuffer( self._buf, 'vimspector.StackTrace' ) utils.SetUpUIWindow( win ) @@ -127,6 +128,7 @@ class StackTraceView( object ): ':call vimspector#SetCurrentThread()' ) win.options[ 'cursorline' ] = False + win.options[ 'signcolumn' ] = 'auto' if not signs.SignDefined( 'vimspectorCurrentThread' ): @@ -136,6 +138,13 @@ class StackTraceView( object ): texthl = 'MatchParen', linehl = 'CursorLine' ) + if not signs.SignDefined( 'vimspectorCurrentFrame' ): + signs.DefineSign( 'vimspectorCurrentFrame', + text = '▶ ', + double_text = '▶', + texthl = 'Special', + linehl = 'CursorLine' ) + self._line_to_frame = {} self._line_to_thread = {} @@ -157,9 +166,12 @@ class StackTraceView( object ): self._sources = {} self._requesting_threads = StackTraceView.ThreadRequestState.NO self._pending_thread_request = None - if self._next_sign_id: - signs.UnplaceSign( self._next_sign_id, 'VimspectorStackTrace' ) - self._next_sign_id = 0 + if self._current_thread_sign_id: + signs.UnplaceSign( self._current_thread_sign_id, 'VimspectorStackTrace' ) + self._current_thread_sign_id = 0 + if self._current_frame_sign_id: + signs.UnplaceSign( self._current_frame_sign_id, 'VimspectorStackTrace' ) + self._current_frame_sign_id = 0 with utils.ModifiableScratchBuffer( self._buf ): utils.ClearBuffer( self._buf ) @@ -273,10 +285,10 @@ class StackTraceView( object ): self._line_to_frame.clear() self._line_to_thread.clear() - if self._next_sign_id: - signs.UnplaceSign( self._next_sign_id, 'VimspectorStackTrace' ) + if self._current_thread_sign_id: + signs.UnplaceSign( self._current_thread_sign_id, 'VimspectorStackTrace' ) else: - self._next_sign_id = 1 + self._current_thread_sign_id = 1 with utils.ModifiableScratchBuffer( self._buf ): with utils.RestoreCursorPosition(): @@ -290,7 +302,7 @@ class StackTraceView( object ): f'({thread.State()})' ) if self._current_thread == thread.id: - signs.PlaceSign( self._next_sign_id, + signs.PlaceSign( self._current_thread_sign_id, 'VimspectorStackTrace', 'vimspectorCurrentThread', self._buf.name, @@ -421,6 +433,7 @@ class StackTraceView( object ): # Should this set the current _Thread_ too ? If i jump to a frame in # Thread 2, should that become the focussed thread ? self._current_frame = frame + self._DrawThreads() return self._session.SetCurrentFrame( self._current_frame, reason ) return False @@ -518,6 +531,11 @@ class StackTraceView( object ): if not thread.IsExpanded(): return + if self._current_frame_sign_id: + signs.UnplaceSign( self._current_frame_sign_id, 'VimspectorStackTrace' ) + else: + self._current_frame_sign_id = 2 + for frame in thread.stacktrace: if frame.get( 'source' ): source = frame[ 'source' ] @@ -542,6 +560,13 @@ class StackTraceView( object ): source[ 'name' ], frame[ 'line' ] ) ) + if self._current_frame[ 'id' ] == frame[ 'id' ]: + signs.PlaceSign( self._current_frame_sign_id, + 'VimspectorStackTrace', + 'vimspectorCurrentFrame', + self._buf.name, + line ) + self._line_to_frame[ line ] = ( thread, frame ) def _ResolveSource( self, source, and_then ): diff --git a/support/test/cpp/simple_c_program/.ycm_extra_conf.py b/support/test/cpp/simple_c_program/.ycm_extra_conf.py index 0d17586..4203b36 100644 --- a/support/test/cpp/simple_c_program/.ycm_extra_conf.py +++ b/support/test/cpp/simple_c_program/.ycm_extra_conf.py @@ -1,4 +1,4 @@ def Settings( **kwargs ): return { - 'flags': [ '-x', 'c++', '-Wall', '-Wextra' ] + 'flags': [ '-x', 'c++', '-Wall', '-Wextra', '-std=c++17' ] } diff --git a/tests/stack_trace.test.vim b/tests/stack_trace.test.vim index a65ea5e..f191201 100644 --- a/tests/stack_trace.test.vim +++ b/tests/stack_trace.test.vim @@ -379,6 +379,20 @@ function! Test_UpDownStack() \ '$' ) \ ) \ } ) + call win_gotoid( g:vimspector_session_windows.stack_trace ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 1, + \ 'vimspectorCurrentThread', + \ 200 ) } ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 2, + \ 'vimspectorCurrentFrame', + \ 200 ) } ) + wincmd w call vimspector#DownFrame() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 15, 1 ) @@ -396,6 +410,21 @@ function! Test_UpDownStack() \ '$' ) \ ) \ } ) + call win_gotoid( g:vimspector_session_windows.stack_trace ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 1, + \ 'vimspectorCurrentThread', + \ 200 ) } ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 2, + \ 'vimspectorCurrentFrame', + \ 200 ) } ) + wincmd w + call vimspector#UpFrame() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 8, 1 ) @@ -413,6 +442,21 @@ function! Test_UpDownStack() \ '$' ) \ ) \ } ) + call win_gotoid( g:vimspector_session_windows.stack_trace ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 1, + \ 'vimspectorCurrentThread', + \ 200 ) } ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 3, + \ 'vimspectorCurrentFrame', + \ 200 ) } ) + wincmd w + call feedkeys( "\VimspectorUpFrame", 'x' ) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 23, 1 ) @@ -430,6 +474,21 @@ function! Test_UpDownStack() \ '$' ) \ ) \ } ) + call win_gotoid( g:vimspector_session_windows.stack_trace ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 1, + \ 'vimspectorCurrentThread', + \ 200 ) } ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 4, + \ 'vimspectorCurrentFrame', + \ 200 ) } ) + wincmd w + call feedkeys( "\VimspectorDownFrame", 'x' ) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 8, 1 ) @@ -447,6 +506,21 @@ function! Test_UpDownStack() \ '$' ) \ ) \ } ) + call win_gotoid( g:vimspector_session_windows.stack_trace ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 1, + \ 'vimspectorCurrentThread', + \ 200 ) } ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 3, + \ 'vimspectorCurrentFrame', + \ 200 ) } ) + wincmd w + call vimspector#DownFrame() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 15, 1 ) @@ -464,6 +538,21 @@ function! Test_UpDownStack() \ '$' ) \ ) \ } ) + call win_gotoid( g:vimspector_session_windows.stack_trace ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 1, + \ 'vimspectorCurrentThread', + \ 200 ) } ) + call WaitForAssert( { -> + \ vimspector#test#signs#AssertSignGroupSingletonAtLine( + \ 'VimspectorStackTrace', + \ 2, + \ 'vimspectorCurrentFrame', + \ 200 ) } ) + wincmd w + call vimspector#ClearBreakpoints() From 0e9497ce8f12d481974397e7c1c7f8378b9bce69 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sat, 15 May 2021 15:50:59 +0100 Subject: [PATCH 26/47] Add cpptools to cpp test proj --- support/test/cpp/simple_c_program/.vimspector.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/support/test/cpp/simple_c_program/.vimspector.json b/support/test/cpp/simple_c_program/.vimspector.json index 7b8c53a..fb4c958 100644 --- a/support/test/cpp/simple_c_program/.vimspector.json +++ b/support/test/cpp/simple_c_program/.vimspector.json @@ -15,6 +15,15 @@ "program": "${workspaceRoot}/test", "stopAtEntry": true } + }, + "cpptools": { + "adapter": "vscode-cpptools", + "configuration": { + "request": "launch", + "program": "${workspaceRoot}/test", + "stopOnEntry": true, + "MIMode": "lldb" + } } } } From aacd62f09feed377c35930790514b2739fa08e51 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sat, 15 May 2021 16:03:02 +0100 Subject: [PATCH 27/47] Rename AssertMatchist -> AssertMatchList --- tests/lib/plugin/shared.vim | 2 +- tests/stack_trace.test.vim | 56 ++++++++++++++++++------------------- tests/variables.test.vim | 44 ++++++++++++++--------------- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/tests/lib/plugin/shared.vim b/tests/lib/plugin/shared.vim index 70e297e..f98b8e9 100644 --- a/tests/lib/plugin/shared.vim +++ b/tests/lib/plugin/shared.vim @@ -99,7 +99,7 @@ function! ThisTestIsFlaky() let g:test_is_flaky = v:true endfunction -function! AssertMatchist( expected, actual ) abort +function! AssertMatchList( expected, actual ) abort let ret = assert_equal( len( a:expected ), len( a:actual ) ) let len = min( [ len( a:expected ), len( a:actual ) ] ) let idx = 0 diff --git a/tests/stack_trace.test.vim b/tests/stack_trace.test.vim index f191201..b5ed795 100644 --- a/tests/stack_trace.test.vim +++ b/tests/stack_trace.test.vim @@ -30,7 +30,7 @@ function! Test_Multiple_Threads_Continue() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call cursor( 1, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( thread_l ) @@ -45,7 +45,7 @@ function! Test_Multiple_Threads_Continue() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call cursor( 1, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( thread_l ) @@ -56,7 +56,7 @@ function! Test_Multiple_Threads_Continue() \ ) \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -70,7 +70,7 @@ function! Test_Multiple_Threads_Continue() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call cursor( 1, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( thread_l ) @@ -81,7 +81,7 @@ function! Test_Multiple_Threads_Continue() \ ) \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -95,7 +95,7 @@ function! Test_Multiple_Threads_Continue() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call cursor( 1, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( thread_l ) @@ -106,7 +106,7 @@ function! Test_Multiple_Threads_Continue() \ ) \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -121,7 +121,7 @@ function! Test_Multiple_Threads_Continue() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call cursor( 1, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( thread_l ) @@ -132,7 +132,7 @@ function! Test_Multiple_Threads_Continue() \ ) \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -146,7 +146,7 @@ function! Test_Multiple_Threads_Continue() " So we break out of the loop call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, notify_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( notify_l ) @@ -157,7 +157,7 @@ function! Test_Multiple_Threads_Continue() \ ) \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -192,7 +192,7 @@ function! Test_Multiple_Threads_Step() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread [0-9]\+: .* (paused)', \ ' .*: .*@threads.cpp:' . string( thread_l ) @@ -205,7 +205,7 @@ function! Test_Multiple_Threads_Step() call vimspector#StepOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_n, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -218,7 +218,7 @@ function! Test_Multiple_Threads_Step() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ ], @@ -230,7 +230,7 @@ function! Test_Multiple_Threads_Step() call vimspector#StepOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_n, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -244,7 +244,7 @@ function! Test_Multiple_Threads_Step() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -257,7 +257,7 @@ function! Test_Multiple_Threads_Step() call vimspector#StepOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_n, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -273,7 +273,7 @@ function! Test_Multiple_Threads_Step() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -287,7 +287,7 @@ function! Test_Multiple_Threads_Step() call vimspector#StepOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_n, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -304,7 +304,7 @@ function! Test_Multiple_Threads_Step() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -319,7 +319,7 @@ function! Test_Multiple_Threads_Step() call vimspector#StepOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, thread_n, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -338,7 +338,7 @@ function! Test_Multiple_Threads_Step() " So we break out of the loop call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, notify_l, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '+ Thread [0-9]\+: .* (paused)', \ '+ Thread [0-9]\+: .* (paused)', @@ -366,7 +366,7 @@ function! Test_UpDownStack() call vimspector#LaunchWithSettings( { 'configuration': 'run' } ) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 15, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread 1: MainThread (paused)', \ ' 2: DoSomething@main.py:15', @@ -397,7 +397,7 @@ function! Test_UpDownStack() call vimspector#DownFrame() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 15, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread 1: MainThread (paused)', \ ' 2: DoSomething@main.py:15', @@ -429,7 +429,7 @@ function! Test_UpDownStack() call vimspector#UpFrame() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 8, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread 1: MainThread (paused)', \ ' 2: DoSomething@main.py:15', @@ -461,7 +461,7 @@ function! Test_UpDownStack() call feedkeys( "\VimspectorUpFrame", 'x' ) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 23, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread 1: MainThread (paused)', \ ' 2: DoSomething@main.py:15', @@ -493,7 +493,7 @@ function! Test_UpDownStack() call feedkeys( "\VimspectorDownFrame", 'x' ) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 8, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread 1: MainThread (paused)', \ ' 2: DoSomething@main.py:15', @@ -525,7 +525,7 @@ function! Test_UpDownStack() call vimspector#DownFrame() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 15, 1 ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Thread 1: MainThread (paused)', \ ' 2: DoSomething@main.py:15', diff --git a/tests/variables.test.vim b/tests/variables.test.vim index c7d373b..59ca2c0 100644 --- a/tests/variables.test.vim +++ b/tests/variables.test.vim @@ -211,7 +211,7 @@ function! Test_ExpandVariables() call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' \*- t (Test): {...}', @@ -229,7 +229,7 @@ function! Test_ExpandVariables() " Step - stays expanded call vimspector#StepOver() call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' - t (Test): {...}', @@ -278,7 +278,7 @@ function! Test_ExpandVariables() call setpos( '.', [ 0, 2, 1 ] ) call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' - t (Test): {...}', @@ -378,7 +378,7 @@ function! Test_ExpandWatch() call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: t', @@ -397,7 +397,7 @@ function! Test_ExpandWatch() " Step - stays expanded call vimspector#StepOver() call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: t', @@ -449,7 +449,7 @@ function! Test_ExpandWatch() call setpos( '.', [ 0, 3, 1 ] ) call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: t', @@ -607,7 +607,7 @@ function! Test_EvaluateFailure() " Add a wtch call vimspector#AddWatch( 'test' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: test', @@ -658,7 +658,7 @@ function! Test_VariableEval() \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', @@ -690,7 +690,7 @@ function! Test_VariableEval() \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', @@ -724,7 +724,7 @@ function! Test_VariableEval() \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Evaluation error', \ ], @@ -768,7 +768,7 @@ function! Test_VariableEvalExpand() \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', @@ -786,7 +786,7 @@ function! Test_VariableEvalExpand() call feedkeys( "jjjj\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', @@ -806,7 +806,7 @@ function! Test_VariableEvalExpand() call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', @@ -863,7 +863,7 @@ function! Test_SetVariableValue_Local() call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' \*- t (Test): {...}', @@ -889,7 +889,7 @@ with mock.patch( 'vimspector.utils.InputSave' ): EOF call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' \*- t (Test): {...}', @@ -908,7 +908,7 @@ EOF call vimspector#SetVariableValue( '1234' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' \*- t (Test): {...}', @@ -927,7 +927,7 @@ EOF call vimspector#SetVariableValue( 'this is invalid' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '- Scope: Locals', \ ' \*- t (Test): {...}', @@ -983,7 +983,7 @@ function! Test_SetVariableValue_Watch() call feedkeys( "\", 'xt' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: t', @@ -1012,7 +1012,7 @@ EOF call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: t', @@ -1032,7 +1032,7 @@ EOF call vimspector#SetVariableValue( '1234' ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ 'Watches: ----', \ 'Expression: t', @@ -1075,7 +1075,7 @@ function! Test_SetVariableValue_Balloon() \ } ) call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', @@ -1102,7 +1102,7 @@ with mock.patch( 'vimspector.utils.InputSave' ): EOF call WaitForAssert( {-> - \ AssertMatchist( + \ AssertMatchList( \ [ \ '{...}', \ ' - i: 0', From d43904eb57c2771c6ba05b48c47da5ff2bbb9735 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sat, 15 May 2021 17:55:01 +0100 Subject: [PATCH 28/47] Add basic VimspectorDebugInfo command --- .github/ISSUE_TEMPLATE/bug_report.md | 6 ++++++ README.md | 2 ++ autoload/vimspector.vim | 8 +++++++ plugin/vimspector.vim | 3 +++ python3/vimspector/debug_session.py | 31 ++++++++++++++++++++++++++++ python3/vimspector/output.py | 26 ++++++++++++++++++----- 6 files changed, 71 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f01a833..828ec18 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -57,6 +57,12 @@ discussing on Gitter rather than raising an issue. * Version of Vimspector: (e.g. output of `git rev-parse HEAD` if cloned or the name of the tarball used to install otherwise) +* Output of `:VimspectorDebugInfo` + +``` +paste here +``` + * Output of `vim --version` or `nvim --version` ``` diff --git a/README.md b/README.md index bf84d2f..f8db3aa 100644 --- a/README.md +++ b/README.md @@ -1070,6 +1070,8 @@ information when something goes wrong that's not a Vim traceback. If you just want to see the Vimspector log file, use `:VimspectorToggleLog`, which will tail it in a little window (doesn't work on Windows). +You can see some debugging info with `:VimspectorDebugInfo` + ## Closing debugger To close the debugger, use: diff --git a/autoload/vimspector.vim b/autoload/vimspector.vim index 1219661..78c7c1b 100644 --- a/autoload/vimspector.vim +++ b/autoload/vimspector.vim @@ -557,6 +557,14 @@ function! vimspector#ShowEvalBalloon( is_visual ) abort \ . '", 0 )' ) endfunction +function! vimspector#PrintDebugInfo() abort + if !s:Enabled() + return + endif + + py3 _vimspector_session.PrintDebugInfo() +endfunction + " Boilerplate {{{ let &cpoptions=s:save_cpo diff --git a/plugin/vimspector.vim b/plugin/vimspector.vim index 27ce473..2668bf1 100644 --- a/plugin/vimspector.vim +++ b/plugin/vimspector.vim @@ -115,6 +115,9 @@ command! -bar -nargs=? -complete=custom,vimspector#CompleteOutput command! -bar \ VimspectorToggleLog \ call vimspector#ToggleLog() +command! -bar + \ VimspectorDebugInfo + \ call vimspector#PrintDebugInfo() command! -nargs=1 -complete=custom,vimspector#CompleteExpr \ VimspectorEval \ call vimspector#Evaluate( ) diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index 2f132f9..36ad62b 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -1270,6 +1270,37 @@ class DebugSession( object ): self._stackTraceView.LoadThreads( True ) + @IfConnected() + @RequiresUI() + def PrintDebugInfo( self ): + def Line(): + return ( "--------------------------------------------------------------" + "------------------" ) + + def Pretty( obj ): + if obj is None: + return [ "None" ] + return [ Line() ] + json.dumps( obj, indent=2 ).splitlines() + [ Line() ] + + + debugInfo = [ + "Vimspector Debug Info", + Line(), + f"ConnectionType: { self._connection_type }", + "Adapter: " ] + Pretty( self._adapter ) + [ + "Configuration: " ] + Pretty( self._configuration ) + [ + f"API Prefix: { self._api_prefix }", + f"Launch/Init: { self._launch_complete } / { self._init_complete }", + f"Workspace Root: { self._workspace_root }", + "Launch Config: " ] + Pretty( self._launch_config ) + [ + "Server Capabilities: " ] + Pretty( self._server_capabilities ) + [ + ] + + self._outputView.ClearCategory( 'DebugInfo' ) + self._outputView.Print( "DebugInfo", debugInfo ) + self.ShowOutput( "DebugInfo" ) + + def OnEvent_loadedSource( self, msg ): pass diff --git a/python3/vimspector/output.py b/python3/vimspector/output.py index c453417..8c94b44 100644 --- a/python3/vimspector/output.py +++ b/python3/vimspector/output.py @@ -64,8 +64,11 @@ class OutputView( object ): self._api_prefix = api_prefix VIEWS.add( self ) - def Print( self, categroy, text ): - self._Print( 'server', text.splitlines() ) + def Print( self, category, text: typing.Union[ str, list ] ): + if not isinstance( text, list ): + text = text.splitlines() + + self._Print( category, text ) def OnOutput( self, event ): category = CategoryToBuffer( event.get( 'category' ) or 'output' ) @@ -104,13 +107,26 @@ class OutputView( object ): def Clear( self ): for category, tab_buffer in self._buffers.items(): - if tab_buffer.is_job: - utils.CleanUpCommand( category, self._api_prefix ) - utils.CleanUpHiddenBuffer( tab_buffer.buf ) + self._CleanUpBuffer( category, tab_buffer ) # FIXME: nunmenu the WinBar ? self._buffers = {} + + def ClearCategory( self, category: str ): + if category not in self._buffers: + return + + self._CleanUpBuffer( category, self._buffers[ category ] ) + + + def _CleanUpBuffer( self, category: str, tab_buffer: TabBuffer ): + if tab_buffer.is_job: + utils.CleanUpCommand( category, self._api_prefix ) + + utils.CleanUpHiddenBuffer( tab_buffer.buf ) + + def WindowIsValid( self ): return self._window.valid From daa8865feab2ec32a60ab2fb11b6f33a0cdeadb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 May 2021 10:56:04 +0000 Subject: [PATCH 29/47] Bump nokogiri from 1.11.3 to 1.11.5 in /docs Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.3 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.3...v1.11.5) Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 6a18520..0fa7776 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -205,14 +205,14 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) - mini_portile2 (2.5.0) + mini_portile2 (2.5.1) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.14.4) multipart-post (2.1.1) - nokogiri (1.11.3) + nokogiri (1.11.5) mini_portile2 (~> 2.5.0) racc (~> 1.4) octokit (4.20.0) From a51b8b23c9b7e12c2899e423037458d46dbe196e Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 25 May 2021 14:53:29 +0100 Subject: [PATCH 30/47] Fix traceback if the current frame isn't set --- python3/vimspector/stack_trace.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python3/vimspector/stack_trace.py b/python3/vimspector/stack_trace.py index f9540ba..8b1d848 100644 --- a/python3/vimspector/stack_trace.py +++ b/python3/vimspector/stack_trace.py @@ -560,7 +560,8 @@ class StackTraceView( object ): source[ 'name' ], frame[ 'line' ] ) ) - if self._current_frame[ 'id' ] == frame[ 'id' ]: + if ( self._current_frame is not None and + self._current_frame[ 'id' ] == frame[ 'id' ] ): signs.PlaceSign( self._current_frame_sign_id, 'VimspectorStackTrace', 'vimspectorCurrentFrame', From 5ea1f0d9d49011259ecedb70df94c6ff799ead62 Mon Sep 17 00:00:00 2001 From: przepompownia Date: Mon, 7 Jun 2021 14:10:44 +0200 Subject: [PATCH 31/47] Upgrade vscode-php-debug to 1.16.0 --- python3/vimspector/gadgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 62321ae..23a298c 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -323,10 +323,10 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.15.1', - 'file_name': 'php-debug-1.15.1.vsix', + 'version': 'v1.16.0', + 'file_name': 'php-debug-1.16.0.vsix', 'checksum': - '10222655d4179c7d109b1f951d88034eba772b45bf6141dcdb4e9b4477d2e2ab', + '62d210f7b87b21315c37ea10a1a5dbae376ff9f963b8f8cf33361e01413731be', }, 'adapters': { 'vscode-php-debug': { From 0500e41429bde17105e931d9920b3c6dbe5eabdb Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 9 Jun 2021 19:24:37 +0200 Subject: [PATCH 32/47] FIx typo in configuration.md A small typo that wastes time for people that copy and modify the config file --- docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index a2864b1..3d524bf 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -722,7 +722,7 @@ Vimspector then orchestrates the various tools to set you up. "variables": { // Just an example of how to specify a variable manually rather than // vimspector asking for input from the user - "ServiceName": "${fileBasenameNoExtention}" + "ServiceName": "${fileBasenameNoExtension}" }, "adapter": "python-remote", From 5075f3a11aba4e31cb7994746862a4342c8546ae Mon Sep 17 00:00:00 2001 From: Simon Drake Date: Thu, 24 Jun 2021 14:40:40 +0100 Subject: [PATCH 33/47] Add a runnable Go example --- README.md | 2 +- .../name-starts-with-vowel/.vimspector.json | 29 ++++++++++++++++ .../test/go/name-starts-with-vowel/README.md | 33 +++++++++++++++++++ .../cmd/namestartswithvowel/main.go | 20 +++++++++++ support/test/go/name-starts-with-vowel/go.mod | 3 ++ .../internal/vowels/vowels.go | 9 +++++ .../internal/vowels/vowels_test.go | 30 +++++++++++++++++ 7 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 support/test/go/name-starts-with-vowel/.vimspector.json create mode 100644 support/test/go/name-starts-with-vowel/README.md create mode 100644 support/test/go/name-starts-with-vowel/cmd/namestartswithvowel/main.go create mode 100644 support/test/go/name-starts-with-vowel/go.mod create mode 100644 support/test/go/name-starts-with-vowel/internal/vowels/vowels.go create mode 100644 support/test/go/name-starts-with-vowel/internal/vowels/vowels_test.go diff --git a/README.md b/README.md index f8db3aa..66f2720 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ If you just want to try out vimspector without changing your vim config, there are example projects for a number of languages in `support/test`, including: * Python (`support/test/python/simple_python`) -* Go (`support/test/go/hello_world`) +* Go (`support/test/go/hello_world` and `support/test/go/name-starts-with-vowel`) * Nodejs (`support/test/node/simple`) * Chrome (`support/test/chrome/`) * etc. diff --git a/support/test/go/name-starts-with-vowel/.vimspector.json b/support/test/go/name-starts-with-vowel/.vimspector.json new file mode 100644 index 0000000..ffcfc93 --- /dev/null +++ b/support/test/go/name-starts-with-vowel/.vimspector.json @@ -0,0 +1,29 @@ +{ + "configurations": { + "run-cmd": { + "adapter": "vscode-go", + "configuration": { + "request": "launch", + "program": "${workspaceRoot}/cmd/namestartswithvowel/main.go", + "mode": "debug", + "dlvToolPath": "$HOME/go/bin/dlv", + "dlvLoadConfig": { + "maxArrayValues": 1000, + "maxStringLen": 1000 + } + } + }, + "test-current-file": { + "adapter": "vscode-go", + "configuration": { + "request": "launch", + "mode": "test", + "program": "${fileDirname}", + "cwd": "${fileDirname}", + "dlvToolPath": "$GOPATH/bin/dlv", + "env": {}, + "args": [] + } + } + } +} diff --git a/support/test/go/name-starts-with-vowel/README.md b/support/test/go/name-starts-with-vowel/README.md new file mode 100644 index 0000000..fec967e --- /dev/null +++ b/support/test/go/name-starts-with-vowel/README.md @@ -0,0 +1,33 @@ +# Purpose + +This example comes with two example vimspector configs for the Go programming language. + +1) `run-cmd` will launch the main programme under `cmd/namestartswithvowel`. +1) `test-current-file` will run the tests in the current file in debug mode. + +## Example use-cases + +### run-cmd + +* Open `cmd/namestartswithvowel/main.go` +* Add a breakpoint somewhere within the programme +* Start the debugger (`:call vimspector#Continue()` or your relevant keymapping) +* Select the first launch configuration (`1: run-cmd`) + +### test-current-file + +* Open `internal/vowels/vowels_test.go` +* Add a breakpoint somewhere within the test +* Start the debugger (`:call vimspector#Continue()` or your relevant keymapping) +* Select the second launch configuration (`2: test-current-file`) + +## Additional Configuration + +There are two additional configuration options specified under `run-cmd`; these parameters configure the maximum string/array size to be shown while debugging. + +``` +"dlvLoadConfig": { + "maxArrayValues": 1000, + "maxStringLen": 1000 +} +``` diff --git a/support/test/go/name-starts-with-vowel/cmd/namestartswithvowel/main.go b/support/test/go/name-starts-with-vowel/cmd/namestartswithvowel/main.go new file mode 100644 index 0000000..c160aea --- /dev/null +++ b/support/test/go/name-starts-with-vowel/cmd/namestartswithvowel/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + + "example.com/internal/vowels" +) + +func main() { + names := []string{"Simon", "Bob", "Jennifer", "Amy", "Duke", "Elizabeth"} + + for _, n := range names { + if vowels.NameStartsWithVowel(n) { + fmt.Printf("%s starts with a vowel!\n", n) + continue + } + + fmt.Printf("%s does not start with a vowel!\n", n) + } +} diff --git a/support/test/go/name-starts-with-vowel/go.mod b/support/test/go/name-starts-with-vowel/go.mod new file mode 100644 index 0000000..3070734 --- /dev/null +++ b/support/test/go/name-starts-with-vowel/go.mod @@ -0,0 +1,3 @@ +module example.com + +go 1.16 diff --git a/support/test/go/name-starts-with-vowel/internal/vowels/vowels.go b/support/test/go/name-starts-with-vowel/internal/vowels/vowels.go new file mode 100644 index 0000000..4e76480 --- /dev/null +++ b/support/test/go/name-starts-with-vowel/internal/vowels/vowels.go @@ -0,0 +1,9 @@ +package vowels + +import "strings" + +func NameStartsWithVowel(name string) bool { + s := strings.Split(strings.ToLower(name), "") + + return s[0] == "a" || s[0] == "e" || s[0] == "i" || s[0] == "o" || s[0] == "u" +} diff --git a/support/test/go/name-starts-with-vowel/internal/vowels/vowels_test.go b/support/test/go/name-starts-with-vowel/internal/vowels/vowels_test.go new file mode 100644 index 0000000..e0d5773 --- /dev/null +++ b/support/test/go/name-starts-with-vowel/internal/vowels/vowels_test.go @@ -0,0 +1,30 @@ +package vowels + +import ( + "fmt" + "testing" +) + +func TestNameStartsWithVowel(t *testing.T) { + testCases := []struct { + input string + expectedOutput bool + }{ + { + input: "Simon", + expectedOutput: false, + }, + { + input: "Andy", + expectedOutput: true, + }, + } + for _, tt := range testCases { + t.Run(fmt.Sprintf("%s should product %t", tt.input, tt.expectedOutput), func(t *testing.T) { + out := NameStartsWithVowel(tt.input) + if out != tt.expectedOutput { + t.Errorf("%s produced %t, when %t was expected", tt.input, out, tt.expectedOutput) + } + }) + } +} From 21ebb22fd44c586f6b22ef393012863b6502a010 Mon Sep 17 00:00:00 2001 From: przepompownia Date: Sun, 4 Jul 2021 23:00:32 +0200 Subject: [PATCH 34/47] Upgrade vscode-php-debug to 1.16.1 --- python3/vimspector/gadgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 23a298c..240fc68 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -323,10 +323,10 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.16.0', - 'file_name': 'php-debug-1.16.0.vsix', + 'version': 'v1.16.1', + 'file_name': 'php-debug-1.16.1.vsix', 'checksum': - '62d210f7b87b21315c37ea10a1a5dbae376ff9f963b8f8cf33361e01413731be', + '2eb6ff1100b6b3d2d160f243858f3524e269078b8154e108d015882e2c0d52c4', }, 'adapters': { 'vscode-php-debug': { From 3af97f192841247a2891c021d935a2e4f15db7c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jul 2021 05:43:17 +0000 Subject: [PATCH 35/47] Bump addressable from 2.7.0 to 2.8.0 in /docs Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/sporkmonger/addressable/releases) - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0) --- updated-dependencies: - dependency-name: addressable dependency-type: indirect ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 0fa7776..acf20f2 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -7,7 +7,7 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) coffee-script (2.4.1) coffee-script-source From 59c9cd10ab9073b91a11ccd9b21c34d8331fa9cb Mon Sep 17 00:00:00 2001 From: przepompownia Date: Mon, 2 Aug 2021 16:11:04 +0200 Subject: [PATCH 36/47] Upgrade vscode-php-debug to 1.17.0 --- python3/vimspector/gadgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 240fc68..170956a 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -323,10 +323,10 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.16.1', - 'file_name': 'php-debug-1.16.1.vsix', + 'version': 'v1.17.0', + 'file_name': 'php-debug-1.17.0.vsix', 'checksum': - '2eb6ff1100b6b3d2d160f243858f3524e269078b8154e108d015882e2c0d52c4', + 'd0fff272503414b6696cc737bc2e18e060fdd5e5dc4bcaf38ae7373afd8d8bc9', }, 'adapters': { 'vscode-php-debug': { From f1e2c12e5bfbb0b9abd1dec75ad8d2810ecc4fc9 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 2 Aug 2021 16:01:47 +0100 Subject: [PATCH 37/47] Update codelldb Add a way to checksum downloads and a little guide to updating gadgets --- python3/vimspector/gadgets.py | 8 ++++---- run_tests | 4 ++-- support/gadget_upgrade/README.md | 8 ++++++++ support/gadget_upgrade/checksum.py | 13 +++++++++++++ 4 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 support/gadget_upgrade/README.md create mode 100755 support/gadget_upgrade/checksum.py diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 170956a..72f13c8 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -394,12 +394,12 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.6.1', + 'version': 'v1.6.5', }, 'macos': { 'file_name': 'codelldb-x86_64-darwin.vsix', 'checksum': - 'b1c998e7421beea9f3ba21aa5706210bb2249eba93c99b809247ee831075262f', + 'e7d9f4f8ec3c3774af6d1dbf11f0568db1417c4d51038927228cd07028725594', 'make_executable': [ 'adapter/codelldb', 'lldb/bin/debugserver', @@ -410,7 +410,7 @@ GADGETS = { 'linux': { 'file_name': 'codelldb-x86_64-linux.vsix', 'checksum': - 'f2a36cb6971fd95a467cf1a7620e160914e8f11bf82929932ee0aa5afbf6ae6a', + 'eda2cd9b3089dcc0524c273e91ffb5875fe08c930bf643739a2cd1846e1f98d6', 'make_executable': [ 'adapter/codelldb', 'lldb/bin/lldb', @@ -421,7 +421,7 @@ GADGETS = { 'windows': { 'file_name': 'codelldb-x86_64-windows.vsix', 'checksum': - 'ca6a6525bf7719dc95265dc630b3cc817a8c0393b756fd242b710805ffdfb940', + '8ddebe8381a3d22dc3d95139c3797fda06b5cc34aadf300e13b1c516b9da95fe', 'make_executable': [] }, 'adapters': { diff --git a/run_tests b/run_tests index 441acb0..201ec1b 100755 --- a/run_tests +++ b/run_tests @@ -21,7 +21,7 @@ out_fd=1 while [ -n "$1" ]; do case "$1" in - "--basedir") + "--basedir"|"--base-dir"|"--test-base") shift SetBaseDir $1 shift @@ -36,7 +36,7 @@ while [ -n "$1" ]; do INSTALL=$1 shift ;; - "--update") + "--update"|"--upgrade") UPDATE=1 shift ;; diff --git a/support/gadget_upgrade/README.md b/support/gadget_upgrade/README.md new file mode 100644 index 0000000..9ae3d7f --- /dev/null +++ b/support/gadget_upgrade/README.md @@ -0,0 +1,8 @@ +# Manually updating shipped gadgets + +Download the gadget files manuall from their official source into this dir. +Run `./checksum.py ` to get the checksums. + +Update ../../python3/vimspector/gadgets.py with the new version and the +checksums. + diff --git a/support/gadget_upgrade/checksum.py b/support/gadget_upgrade/checksum.py new file mode 100755 index 0000000..d0c1404 --- /dev/null +++ b/support/gadget_upgrade/checksum.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import hashlib +import sys + + +def GetChecksumSHA254( file_path ): + with open( file_path, 'rb' ) as existing_file: + return hashlib.sha256( existing_file.read() ).hexdigest() + + +for arg in sys.argv[ 1: ]: + print( f"{ arg } = { GetChecksumSHA254( arg ) }" ) From 57ce0992803fcf22c0557550fff45e3fe869f707 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 3 Aug 2021 17:29:55 +0100 Subject: [PATCH 38/47] SHow the output in the console, as this is where codelldb puts it --- python3/vimspector/output.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python3/vimspector/output.py b/python3/vimspector/output.py index 8c94b44..3f0da1e 100644 --- a/python3/vimspector/output.py +++ b/python3/vimspector/output.py @@ -32,6 +32,7 @@ class TabBuffer( object ): BUFFER_MAP = { 'console': 'Console', 'stdout': 'Console', + 'output': 'Console', 'stderr': 'stderr', 'telemetry': None, } From 7c7e3f9c3f63de7ef91e5d579662a4e16be95315 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 20 Aug 2021 11:17:05 +0100 Subject: [PATCH 39/47] Add config for bash to tests --- support/test/bash/.vimspector.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 support/test/bash/.vimspector.json diff --git a/support/test/bash/.vimspector.json b/support/test/bash/.vimspector.json new file mode 100644 index 0000000..a1be1b9 --- /dev/null +++ b/support/test/bash/.vimspector.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json", + "configurations": { + "Run Current Script": { + "adapter": "vscode-bash", + "autoselect": false, + "configuration": { + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "args": [ "*${args}" ] + } + } + } +} From a720d0e1d56743bb1f335b2a4bcb963491e9b421 Mon Sep 17 00:00:00 2001 From: roachsinai Date: Sat, 21 Aug 2021 00:57:27 +0800 Subject: [PATCH 40/47] Fix error: E806: using Float as a String. --- support/custom_ui_vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/custom_ui_vimrc b/support/custom_ui_vimrc index a8812cb..e76c6ee 100644 --- a/support/custom_ui_vimrc +++ b/support/custom_ui_vimrc @@ -54,7 +54,7 @@ function s:SetUpTerminal() let padding = 4 let cols = max( [ min( [ &columns - left_bar - code - padding, 80 ] ), 10 ] ) call win_gotoid( terminal_win ) - execute cols . 'wincmd |' + execute string(cols) . 'wincmd |' endfunction function! s:CustomiseWinBar() From 51d78fce5f95fb10ba84b8ab66e97d44d75df010 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 7 Sep 2021 17:00:04 +0100 Subject: [PATCH 41/47] Note on using legacy vscode-dap --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 66f2720..3420d56 100644 --- a/README.md +++ b/README.md @@ -1368,6 +1368,8 @@ Requires: * [Delve][delve-install] installed, e.g. `go get -u github.com/go-delve/delve/cmd/dlv` * Delve to be in your PATH, or specify the `dlvToolPath` launch option +NOTE: Vimspector uses the ["legacy" vscode-go debug adapter](https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md) rather than the "built-in" DAP support in Delve. You can track https://github.com/puremourning/vimspector/issues/186 for that. + ```json { "configurations": { @@ -1385,7 +1387,7 @@ Requires: ``` See the vscode-go docs for -[troubleshooting information](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#troubleshooting) +[troubleshooting information](https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md#troubleshooting) ## PHP From 46cfdc678dbdbb162f8cb8ab4384897e1a3d3bd0 Mon Sep 17 00:00:00 2001 From: Sebastian Goth Date: Wed, 8 Sep 2021 12:19:51 +0200 Subject: [PATCH 42/47] Update vscode-cpptools from 0.27.0 to 1.6.0 --- python3/vimspector/gadgets.py | 10 +++++----- python3/vimspector/installer.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 72f13c8..dda962d 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -30,12 +30,12 @@ GADGETS = { root, gadget ), 'all': { - 'version': '0.27.0', + 'version': '1.6.0', "adapters": { "vscode-cpptools": { "name": "cppdbg", "command": [ - "${gadgetDir}/vscode-cpptools/debugAdapters/OpenDebugAD7" + "${gadgetDir}/vscode-cpptools/debugAdapters/bin/OpenDebugAD7" ], "attach": { "pidProperty": "processId", @@ -53,17 +53,17 @@ GADGETS = { 'linux': { 'file_name': 'cpptools-linux.vsix', 'checksum': - '3695202e1e75a03de18049323b66d868165123f26151f8c974a480eaf0205435', + 'c25299bcfb46b22d41aa3f125df7184e6282a35ff9fb69c47def744cb4778f55', }, 'macos': { 'file_name': 'cpptools-osx.vsix', 'checksum': - 'cb061e3acd7559a539e5586f8d3f535101c4ec4e8a48195856d1d39380b5cf3c', + 'ae21cde361335b350402904991cf9f746fec685449ca9bd5d50227c3dec3719b', }, 'windows': { 'file_name': 'cpptools-win32.vsix', 'checksum': - 'aa294368ed16d48c59e49c8000e146eae5a19ad07b654efed5db8ec93b24229e', + 'ef7ac5831874a3c7dbf0feb826bfda2be579aff9b6d990622fff1d0d4ede00d1', "adapters": { "vscode-cpptools": { "name": "cppdbg", diff --git a/python3/vimspector/installer.py b/python3/vimspector/installer.py index f0f85a4..a81db8f 100644 --- a/python3/vimspector/installer.py +++ b/python3/vimspector/installer.py @@ -358,7 +358,8 @@ def InstallCppTools( name, root, gadget ): # It's hilarious, but the execute bits aren't set in the vsix. So they # actually have javascript code which does this. It's just a horrible horrible # hack that really is not funny. - MakeExecutable( os.path.join( extension, 'debugAdapters', 'OpenDebugAD7' ) ) + MakeExecutable( + os.path.join( extension, 'debugAdapters', 'bin', 'OpenDebugAD7' ) ) with open( os.path.join( extension, 'package.json' ) ) as f: package = json.load( f ) runtime_dependencies = package[ 'runtimeDependencies' ] From 561a5b9aa2c0c0a9f801b12af3cd7ef861fad962 Mon Sep 17 00:00:00 2001 From: Sebastian Goth Date: Wed, 8 Sep 2021 21:36:37 +0200 Subject: [PATCH 43/47] Update variables tests to expect register scope vscode-cpptools 1.6.0 now reports an additional scope 'Registers' after 'Locals'. --- tests/variables.test.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/variables.test.vim b/tests/variables.test.vim index 59ca2c0..c00fb7f 100644 --- a/tests/variables.test.vim +++ b/tests/variables.test.vim @@ -194,6 +194,7 @@ function! Test_ExpandVariables() \ [ \ '- Scope: Locals', \ ' *+ t (Test): {...}', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -219,6 +220,7 @@ function! Test_ExpandVariables() \ ' \*- c (char): 0 ''\\0\{1,3}''', \ ' \*- fffff (float): 0', \ ' \*+ another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -237,6 +239,7 @@ function! Test_ExpandVariables() \ ' - c (char): 0 ''\\0\{1,3}''', \ ' - fffff (float): 0', \ ' + another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -253,6 +256,7 @@ function! Test_ExpandVariables() \ [ \ '- Scope: Locals', \ ' + t (Test): {...}', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -267,6 +271,7 @@ function! Test_ExpandVariables() \ [ \ '- Scope: Locals', \ ' + t (Test): {...}', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -286,6 +291,7 @@ function! Test_ExpandVariables() \ ' \*- c (char): 99 ''c''', \ ' \*- fffff (float): 0', \ ' \*+ another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -302,6 +308,7 @@ function! Test_ExpandVariables() \ assert_equal( \ [ \ '+ Scope: Locals', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -316,6 +323,7 @@ function! Test_ExpandVariables() \ assert_equal( \ [ \ '+ Scope: Locals', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -331,6 +339,7 @@ function! Test_ExpandVariables() \ assert_equal( \ [ \ '+ Scope: Locals', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -846,6 +855,7 @@ function! Test_SetVariableValue_Local() \ [ \ '- Scope: Locals', \ ' *+ t (Test): {...}', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -871,6 +881,7 @@ function! Test_SetVariableValue_Local() \ ' \*- c (char): 0 ''\\0\{1,3}''', \ ' \*- fffff (float): 0', \ ' \*+ another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -897,6 +908,7 @@ EOF \ ' \*- c (char): 0 ''\\0\{1,3}''', \ ' \*- fffff (float): 0', \ ' \*+ another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -916,6 +928,7 @@ EOF \ ' \*- c (char): 0 ''\\0\{1,3}''', \ ' \*- fffff (float): 0', \ ' \*+ another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, @@ -935,6 +948,7 @@ EOF \ ' \*- c (char): 0 ''\\0\{1,3}''', \ ' \*- fffff (float): 0', \ ' \*+ another_test (AnotherTest):\( {...}\)\?', + \ '+ Scope: Registers', \ ], \ getbufline( winbufnr( g:vimspector_session_windows.variables ), \ 1, From 17ca1522f8a0cca53c8ab75a680f27ea58b50de3 Mon Sep 17 00:00:00 2001 From: Sebastian Goth Date: Wed, 8 Sep 2021 23:16:47 +0200 Subject: [PATCH 44/47] Use correct spelling of MIMode in tests --- tests/testdata/cpp/simple/.vimspector.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testdata/cpp/simple/.vimspector.json b/tests/testdata/cpp/simple/.vimspector.json index 0dca061..48ce801 100644 --- a/tests/testdata/cpp/simple/.vimspector.json +++ b/tests/testdata/cpp/simple/.vimspector.json @@ -12,7 +12,7 @@ "externalConsole": false, "stopAtEntry": true, "stopOnEntry": true, - "MImode": "${VIMSPECTOR_MIMODE}" + "MIMode": "${VIMSPECTOR_MIMODE}" }, "breakpoints": { "exception": { @@ -33,7 +33,7 @@ "externalConsole": false, "stopAtEntry": false, "stopOnEntry": false, - "MImode": "${VIMSPECTOR_MIMODE}" + "MIMode": "${VIMSPECTOR_MIMODE}" }, "breakpoints": { "exception": { @@ -55,7 +55,7 @@ "externalConsole": false, "stopAtEntry": false, "stopOnEntry": false, - "MImode": "${VIMSPECTOR_MIMODE}" + "MIMode": "${VIMSPECTOR_MIMODE}" }, "breakpoints": { "exception": { @@ -82,7 +82,7 @@ "configuration": { "request": "launch", "program": "${workspaceRoot}/${fileBasenameNoExtension}", - "MImode": "${VIMSPECTOR_MIMODE}", + "MIMode": "${VIMSPECTOR_MIMODE}", "externalConsole": false, "args": [ "CALCULATED_LIST", "${CALCULATED_LIST}", From db5ed8e80228fbb5366e6fc7629e430f886d2b34 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 8 Sep 2021 22:20:33 +0100 Subject: [PATCH 45/47] Update to ubuntu 18.04 as 16.04 is deprecated --- .github/workflows/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 14f5979..f186f5d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ defaults: jobs: PythonLint: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 container: 'puremourning/vimspector:test' steps: - uses: actions/checkout@v2 @@ -22,7 +22,7 @@ jobs: - name: 'Run flake8' run: '$HOME/.local/bin/flake8 python3/ *.py' VimscriptLint: - runs-on: 'ubuntu-16.04' + runs-on: 'ubuntu-18.04' container: 'puremourning/vimspector:test' steps: - uses: actions/checkout@v2 @@ -32,7 +32,7 @@ jobs: run: $HOME/.local/bin/vint autoload/ compiler/ plugin/ tests/ syntax/ Linux: - runs-on: 'ubuntu-16.04' + runs-on: 'ubuntu-18.04' container: image: 'puremourning/vimspector:test' options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined @@ -156,7 +156,7 @@ jobs: # SSH_PASS: ${{ secrets.SSH_PASS }} # [V]imspector PublishRelease: - runs-on: 'ubuntu-16.04' + runs-on: 'ubuntu-18.04' needs: - Linux - MacOS From dc862fe565a74a9810f37edaa8d0e1bb7bbdd79d Mon Sep 17 00:00:00 2001 From: Sebastian Goth Date: Thu, 9 Sep 2021 16:42:49 +0200 Subject: [PATCH 46/47] Readme: pretty printing with vscode-cpptools / gdb --- README.md | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3420d56..d198292 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,10 @@ For detailed explanation of the `.vimspector.json` format, see the * [Closing debugger](#closing-debugger) * [Terminate debuggee](#terminate-debuggee) * [Debug profile configuration](#debug-profile-configuration) - * [C, C , Rust, etc.](#c-c-rust-etc) - * [C Remote debugging](#c-remote-debugging) - * [C Remote launch and attach](#c-remote-launch-and-attach) + * [C, C++, Rust, etc.](#c-c-rust-etc) + * [Data visualization / pretty printing](#data-visualization--pretty-printing) + * [C++ Remote debugging](#c-remote-debugging) + * [C++ Remote launch and attach](#c-remote-launch-and-attach) * [Rust](#rust) * [Python](#python) * [Python Remote Debugging](#python-remote-debugging) @@ -1176,6 +1177,38 @@ licensing. } ``` +### Data visualization / pretty printing + +Depending on the backend you need to enable pretty printing of complex types manually. + +* LLDB: Pretty printing is enabled by default + +* GDB: To enable gdb pretty printers, consider the snippet below. + It is not enough to have `set print pretty on` in your .gdbinit! + +``` +{ + "configurations": { + "Launch": { + "adapter": "vscode-cpptools", + "configuration": { + "request": "launch", + "program": "", + ... + "MIMode": "gdb" + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + } + } + } +} +``` + ### C++ Remote debugging The cpptools documentation describes how to attach cpptools to gdbserver using From 7c12519b9d87f261abfff62f4f197c693a0ffb4f Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Fri, 10 Sep 2021 10:30:44 -0600 Subject: [PATCH 47/47] Modify for mac m1 --- python3/vimspector/gadgets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index dda962d..02eb0e7 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -56,9 +56,9 @@ GADGETS = { 'c25299bcfb46b22d41aa3f125df7184e6282a35ff9fb69c47def744cb4778f55', }, 'macos': { - 'file_name': 'cpptools-osx.vsix', + 'file_name': 'cpptools-osx-arm64.vsix', 'checksum': - 'ae21cde361335b350402904991cf9f746fec685449ca9bd5d50227c3dec3719b', + 'ceb3e8cdaa2b5bb45af50913ddd8402089969748af8d70f5d46480408287ba6f', }, 'windows': { 'file_name': 'cpptools-win32.vsix', @@ -394,12 +394,12 @@ GADGETS = { '${version}/${file_name}', }, 'all': { - 'version': 'v1.6.5', + 'version': 'v1.6.6', }, 'macos': { - 'file_name': 'codelldb-x86_64-darwin.vsix', + 'file_name': 'codelldb-aarch64-darwin.vsix', 'checksum': - 'e7d9f4f8ec3c3774af6d1dbf11f0568db1417c4d51038927228cd07028725594', + '5adc3b9139eabdafd825bd5efc55df4424a203fb2b6087b425cd434956e7ec58', 'make_executable': [ 'adapter/codelldb', 'lldb/bin/debugserver',