Add SetLineBreakpoint and ClaerLineBreakpoint APIs
These are useful for running tests (i.e. ensure there's a breakpiont at the start of the test) and/or other programmatic usages. They will also be needed for setting temporary breakpionts.
This commit is contained in:
parent
78bec87f4e
commit
0d112d70a0
5 changed files with 105 additions and 44 deletions
|
|
@ -76,6 +76,31 @@ function! vimspector#ToggleBreakpoint( ... ) abort
|
|||
py3 _vimspector_session.ToggleBreakpoint( vim.eval( 'options' ) )
|
||||
endfunction
|
||||
|
||||
function! vimspector#SetLineBreakpoint( file_name, line_num, ... ) abort
|
||||
if !s:enabled
|
||||
return
|
||||
endif
|
||||
if a:0 == 0
|
||||
let options = {}
|
||||
else
|
||||
let options = a:1
|
||||
endif
|
||||
py3 _vimspector_session.SetLineBreakpoint(
|
||||
\ vim.eval( 'a:file_name' ),
|
||||
\ int( vim.eval( 'a:line_num' ) ),
|
||||
\ vim.eval( 'options' ) )
|
||||
endfunction
|
||||
|
||||
function! vimspector#ClearLineBreakpoint( file_name, line_num ) abort
|
||||
if !s:enabled
|
||||
return
|
||||
endif
|
||||
py3 _vimspector_session.ClearLineBreakpoint(
|
||||
\ vim.eval( 'a:file_name' ),
|
||||
\ int( vim.eval( 'a:line_num' ) ) )
|
||||
endfunction
|
||||
|
||||
|
||||
function! vimspector#AddFunctionBreakpoint( function, ... ) abort
|
||||
if !s:enabled
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue