commit
cf2ac77391
4 changed files with 33 additions and 3 deletions
|
|
@ -57,11 +57,13 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort
|
||||||
|
|
||||||
let l:addr = 'localhost:' . a:config[ 'port' ]
|
let l:addr = 'localhost:' . a:config[ 'port' ]
|
||||||
|
|
||||||
|
echo 'Connecting to ' . l:addr . '... (waiting fo up to 10 seconds)'
|
||||||
let s:ch = ch_open( l:addr,
|
let s:ch = ch_open( l:addr,
|
||||||
\ {
|
\ {
|
||||||
\ 'mode': 'raw',
|
\ 'mode': 'raw',
|
||||||
\ 'callback': funcref( 's:_OnServerData' ),
|
\ 'callback': funcref( 's:_OnServerData' ),
|
||||||
\ 'close_cb': funcref( 's:_OnClose' ),
|
\ 'close_cb': funcref( 's:_OnClose' ),
|
||||||
|
\ 'waittime': 10000,
|
||||||
\ }
|
\ }
|
||||||
\ )
|
\ )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,10 +84,10 @@ GADGETS = {
|
||||||
'${version}/${file_name}',
|
'${version}/${file_name}',
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
'version': '2019.5.17059',
|
'version': '2019.10.41019',
|
||||||
'file_name': 'ms-python-release.vsix',
|
'file_name': 'ms-python-release.vsix',
|
||||||
'checksum':
|
'checksum':
|
||||||
'db31c9d835318209f4b26948db8b7c68b45ca4c341f6c17bb8e62dfc32f0b78d',
|
'38e8bf782fc6d2dc904868add2e1e5dc66197a06a902f6d17e15f96d4e9bf16b',
|
||||||
},
|
},
|
||||||
'adapters': {
|
'adapters': {
|
||||||
"vscode-python": {
|
"vscode-python": {
|
||||||
|
|
@ -480,6 +480,10 @@ parser.add_argument( '--all',
|
||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
help = 'Enable all supported completers' )
|
help = 'Enable all supported completers' )
|
||||||
|
|
||||||
|
parser.add_argument( '--force-all',
|
||||||
|
action = 'store_true',
|
||||||
|
help = 'Enable all unsupported completers' )
|
||||||
|
|
||||||
done_languages = set()
|
done_languages = set()
|
||||||
for name, gadget in GADGETS.items():
|
for name, gadget in GADGETS.items():
|
||||||
lang = gadget[ 'language' ]
|
lang = gadget[ 'language' ]
|
||||||
|
|
@ -511,11 +515,15 @@ for name, gadget in GADGETS.items():
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.force_all and not args.all:
|
||||||
|
args.all = True
|
||||||
|
|
||||||
failed = []
|
failed = []
|
||||||
all_adapters = {}
|
all_adapters = {}
|
||||||
for name, gadget in GADGETS.items():
|
for name, gadget in GADGETS.items():
|
||||||
if not gadget.get( 'enabled', True ):
|
if not gadget.get( 'enabled', True ):
|
||||||
if not getattr( args, 'force_enable_' + gadget[ 'language' ] ):
|
if ( not args.force_all
|
||||||
|
and not getattr( args, 'force_enable_' + gadget[ 'language' ] ) ):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if not args.all and not getattr( args, 'enable_' + gadget[ 'language' ] ):
|
if not args.all and not getattr( args, 'enable_' + gadget[ 'language' ] ):
|
||||||
|
|
|
||||||
|
|
@ -272,6 +272,11 @@ class ProjectBreakpoints( object ):
|
||||||
|
|
||||||
if exception_breakpoint_filters or not self._server_capabilities.get(
|
if exception_breakpoint_filters or not self._server_capabilities.get(
|
||||||
'supportsConfigurationDoneRequest' ):
|
'supportsConfigurationDoneRequest' ):
|
||||||
|
# Note the supportsConfigurationDoneRequest part: prior to there being a
|
||||||
|
# configuration done request, the "exception breakpoints" request was the
|
||||||
|
# indication that configuraiton was done (and its response is used to
|
||||||
|
# trigger requesting threads etc.). See the note in
|
||||||
|
# debug_session.py:_Initialise for more detials
|
||||||
exception_filters = []
|
exception_filters = []
|
||||||
if exception_breakpoint_filters:
|
if exception_breakpoint_filters:
|
||||||
for f in exception_breakpoint_filters:
|
for f in exception_breakpoint_filters:
|
||||||
|
|
|
||||||
|
|
@ -599,6 +599,21 @@ class DebugSession( object ):
|
||||||
return [ command ]
|
return [ command ]
|
||||||
|
|
||||||
def _Initialise( self ):
|
def _Initialise( self ):
|
||||||
|
# For a good explaination as to why this sequence is the way it is, see
|
||||||
|
# https://github.com/microsoft/vscode/issues/4902#issuecomment-368583522
|
||||||
|
#
|
||||||
|
# In short, we do what VSCode does:
|
||||||
|
# 1. Send the initialize request and wait for the reply
|
||||||
|
# 2a. When we recieve the initialize reply, send the launch/attach request
|
||||||
|
# 2b. When we receive the initialized notification, send the breakpoints
|
||||||
|
# - if supportsConfigurationDoneRequest, send it
|
||||||
|
# - else, send the empty exception breakpoints request
|
||||||
|
# 3. When we have recieved both the receive the launch/attach reply *and*
|
||||||
|
# the connfiguration done reply (or, if we didn't send one, a response to
|
||||||
|
# the empty exception breakpoints request), we request threads
|
||||||
|
# 4. The threads response triggers things like scopes and triggers setting
|
||||||
|
# the current frame.
|
||||||
|
#
|
||||||
def handle_initialize_response( msg ):
|
def handle_initialize_response( msg ):
|
||||||
self._server_capabilities = msg.get( 'body' ) or {}
|
self._server_capabilities = msg.get( 'body' ) or {}
|
||||||
self._breakpoints.SetServerCapabilities( self._server_capabilities )
|
self._breakpoints.SetServerCapabilities( self._server_capabilities )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue