Handle failed breakpoint messages

This commit is contained in:
Ben Jackson 2019-12-20 12:02:26 +00:00
commit 8bb7017a49

View file

@ -203,14 +203,18 @@ class ProjectBreakpoints( object ):
awaiting = 0 awaiting = 0
def response_handler( source, msg ): def response_received():
if msg:
self._breakpoints_handler.AddBreakpoints( source, msg )
nonlocal awaiting nonlocal awaiting
awaiting = awaiting - 1 awaiting = awaiting - 1
if awaiting == 0 and doneHandler: if awaiting == 0 and doneHandler:
doneHandler() doneHandler()
def response_handler( source, msg ):
if msg:
self._breakpoints_handler.AddBreakpoints( source, msg )
response_received()
# TODO: add the _configured_breakpoints to line_breakpoints # TODO: add the _configured_breakpoints to line_breakpoints
# TODO: the line numbers might have changed since pressing the F9 key! # TODO: the line numbers might have changed since pressing the F9 key!
@ -244,7 +248,8 @@ class ProjectBreakpoints( object ):
'breakpoints': breakpoints, 'breakpoints': breakpoints,
}, },
'sourceModified': False, # TODO: We can actually check this 'sourceModified': False, # TODO: We can actually check this
} },
failure_handler = lambda *_: response_received()
) )
# TODO: Add the _configured_breakpoints to function breakpoints # TODO: Add the _configured_breakpoints to function breakpoints
@ -261,7 +266,8 @@ class ProjectBreakpoints( object ):
for bp in self._func_breakpoints if bp[ 'state' ] == 'ENABLED' for bp in self._func_breakpoints if bp[ 'state' ] == 'ENABLED'
], ],
} }
} },
failure_handler = lambda *_: response_received()
) )
if self._exception_breakpoints is None: if self._exception_breakpoints is None:
@ -274,7 +280,8 @@ class ProjectBreakpoints( object ):
{ {
'command': 'setExceptionBreakpoints', 'command': 'setExceptionBreakpoints',
'arguments': self._exception_breakpoints 'arguments': self._exception_breakpoints
} },
failure_handler = lambda *_: response_received()
) )
if awaiting == 0 and doneHandler: if awaiting == 0 and doneHandler: