Add ClearBreakpoints API

Add a test which actually triggers the mappings and fires up vimspector
with the cpptools debugger.
This commit is contained in:
Ben Jackson 2019-04-28 09:35:59 +01:00
commit 470c64603a
11 changed files with 155 additions and 19 deletions

View file

@ -29,10 +29,10 @@ class ProjectBreakpoints( object ):
# These are the user-entered breakpoints.
self._line_breakpoints = defaultdict( list )
self._func_breakpoints = []
self._exceptionBreakpoints = None
# FIXME: Remove this. Remove breakpoints nonesense from code.py
self._breakpoints_handler = None
self._exceptionBreakpoints = None
self._server_capabilities = {}
self._next_sign_id = 1
@ -92,6 +92,14 @@ class ProjectBreakpoints( object ):
vim.eval( 'setqflist( {} )'.format( json.dumps( qf ) ) )
def ClearBreakpoints( self ):
# These are the user-entered breakpoints.
self._line_breakpoints = defaultdict( list )
self._func_breakpoints = []
self._exceptionBreakpoints = None
self.UpdateUI()
def ToggleBreakpoint( self ):
line, column = vim.current.window.cursor
file_name = vim.current.buffer.name
@ -211,6 +219,7 @@ class ProjectBreakpoints( object ):
}
)
def _SetUpExceptionBreakpoints( self ):
exceptionBreakpointFilters = self._server_capabilities.get(
'exceptionBreakpointFilters',

View file

@ -724,5 +724,8 @@ class DebugSession( object ):
def ToggleBreakpoint( self ):
return self._breakpoints.ToggleBreakpoint()
def ClearBreakpoints( self ):
return self._breakpoints.ClearBreakpoints()
def AddFunctionBreakpoint( self, function ):
return self._breakpoints.AddFunctionBreakpoint( function )