Merge pull request #62 from puremourning/python-ptvsd

Python ptvsd
This commit is contained in:
mergify[bot] 2019-10-13 19:04:47 +00:00 committed by GitHub
commit cf2ac77391
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 3 deletions

View file

@ -57,11 +57,13 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort
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,
\ {
\ 'mode': 'raw',
\ 'callback': funcref( 's:_OnServerData' ),
\ 'close_cb': funcref( 's:_OnClose' ),
\ 'waittime': 10000,
\ }
\ )

View file

@ -84,10 +84,10 @@ GADGETS = {
'${version}/${file_name}',
},
'all': {
'version': '2019.5.17059',
'version': '2019.10.41019',
'file_name': 'ms-python-release.vsix',
'checksum':
'db31c9d835318209f4b26948db8b7c68b45ca4c341f6c17bb8e62dfc32f0b78d',
'38e8bf782fc6d2dc904868add2e1e5dc66197a06a902f6d17e15f96d4e9bf16b',
},
'adapters': {
"vscode-python": {
@ -480,6 +480,10 @@ parser.add_argument( '--all',
action = 'store_true',
help = 'Enable all supported completers' )
parser.add_argument( '--force-all',
action = 'store_true',
help = 'Enable all unsupported completers' )
done_languages = set()
for name, gadget in GADGETS.items():
lang = gadget[ 'language' ]
@ -511,11 +515,15 @@ for name, gadget in GADGETS.items():
args = parser.parse_args()
if args.force_all and not args.all:
args.all = True
failed = []
all_adapters = {}
for name, gadget in GADGETS.items():
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
else:
if not args.all and not getattr( args, 'enable_' + gadget[ 'language' ] ):

View file

@ -272,6 +272,11 @@ class ProjectBreakpoints( object ):
if exception_breakpoint_filters or not self._server_capabilities.get(
'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 = []
if exception_breakpoint_filters:
for f in exception_breakpoint_filters:

View file

@ -599,6 +599,21 @@ class DebugSession( object ):
return [ command ]
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 ):
self._server_capabilities = msg.get( 'body' ) or {}
self._breakpoints.SetServerCapabilities( self._server_capabilities )