File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 6060--- @field remove fun ( bufnr : integer , line : integer )
6161
6262--- @return dapui.BreakpointsProxy
63- local function create_breakpoints_proxy (breakpoints )
63+ local function create_breakpoints_proxy (breakpoints , session_factory )
6464 local proxy = {}
65+ local function refresh (bufnr )
66+ local bps = breakpoints .get (bufnr )
67+ local session = session_factory ()
68+ if session then
69+ session :set_breakpoints (bps )
70+ end
71+ end
72+
6573 proxy .get = function ()
6674 return breakpoints .get ()
6775 end
@@ -70,9 +78,11 @@ local function create_breakpoints_proxy(breakpoints)
7078 end
7179 proxy .toggle = function (bufnr , line , args )
7280 breakpoints .toggle (args , bufnr , line )
81+ refresh (bufnr )
7382 end
7483 proxy .remove = function (bufnr , line )
7584 breakpoints .remove (bufnr , line )
85+ refresh (bufnr )
7686 end
7787 return proxy
7888end
@@ -168,7 +178,7 @@ local function create_client(session_factory, breakpoints)
168178 })
169179
170180 local client = setmetatable ({
171- breakpoints = create_breakpoints_proxy (breakpoints ),
181+ breakpoints = create_breakpoints_proxy (breakpoints , session_factory ),
172182 request = request ,
173183 listen = listen ,
174184 shutdown = function ()
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ function M.client(args)
9797 seq = 0 ,
9898 stopped_thread_id = args .stopped_thread_id ,
9999 current_frame = args .current_frame ,
100+ set_breakpoints = function () end ,
100101
101102 request = function (_ , command , request_args , callback )
102103 session .seq = session .seq + 1
You can’t perform that action at this time.
0 commit comments