You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to get a breakpoint at a specific line number at the moment. The breakpoint.get api can be extended to match the other api's for breakpoints to optionally get a line number, similarly to toggle,remove, set etc.
Possible Solutions
No response
Considered Alternatives
At the moment we have to do use get, to get all of them, and then filter on the line number, to get the one we want.
The text was updated successfully, but these errors were encountered:
For me i have done something like that, to obtain a break point at a line if there is any (see below). The reason is that i have a binding which can update / edit a breakpoint at a position to change
condition/logmessage/hitCondition, so it has to check if there is already breakpoint present at the given line number to obtain the current state/config for the breakpoint, then i run set_breakpoint to replace it with the updated state (which is based on the original bp), otherwise if none exists a new bp will be created with default state again using the set_breakpoint api.
localok, bp=pcall(require, "dap.breakpoints")
ifnotokornotbpthenreturn {}
endlocalpoints=bp.get(vim.api.nvim_get_current_buf())
local_, entry=next(pointsor {})
ifentrythen-- TODO: not the best idea, there should be an-- api in dap to get the bp by linenr directlylocallnum=vim.api.nvim_win_get_cursor(0)[1]
for_, ptinipairs(entry) doifptandpt.line==lnumthenreturnptendendendreturnnil
Problem Statement
There is no way to get a breakpoint at a specific line number at the moment. The
breakpoint.get
api can be extended to match the other api's for breakpoints to optionally get a line number, similarly to toggle,remove, set etc.Possible Solutions
No response
Considered Alternatives
At the moment we have to do use get, to get all of them, and then filter on the line number, to get the one we want.
The text was updated successfully, but these errors were encountered: