Skip to content

Commit

Permalink
Follow in-official breakpoint "removed" convention
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Oct 14, 2024
1 parent 2de4925 commit 29415cf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -1957,17 +1957,20 @@ BODY is an plist of adapter capabilities."
Update `dape--breakpoints' according to BODY."
(when-let ((update (plist-get body :breakpoint))
(id (plist-get update :id)))
;; Until `:reason' gets properly speced, try to infer update
;; intention, would prefer `pcase' on `:reason'.
(if-let ((breakpoint
(cl-find id dape--breakpoints
:key (lambda (breakpoint)
(plist-get (dape--breakpoint-id breakpoint) conn)))))
(dape--breakpoint-update conn breakpoint update)
(dape--with-request (dape--source-ensure conn update)
(when-let ((marker (dape--object-to-marker conn update)))
(dape--with-line (marker-buffer marker) (plist-get update :line)
(dape--message "Creating breakpoint in %s:%d"
(buffer-name) (plist-get update :line))
(dape--breakpoint-place)))))))
(unless (equal (plist-get body :reason) "removed")
(dape--with-request (dape--source-ensure conn update)
(when-let ((marker (dape--object-to-marker conn update)))
(dape--with-line (marker-buffer marker) (plist-get update :line)
(dape--message "Creating breakpoint in %s:%d"
(buffer-name) (plist-get update :line))
(dape--breakpoint-place))))))))

(cl-defmethod dape-handle-event (conn (_event (eql module)) body)
"Handle adapter CONNs module events.
Expand Down

0 comments on commit 29415cf

Please sign in to comment.