branch: externals/dape commit 0a93e6a6ace94ee4baead97dfb3e45b3b6f0c168 Author: jrciii <josephcooper...@gmail.com> Commit: GitHub <nore...@github.com>
Implement RestartFrame (#244) Copyright-paperwork-exempt: yes --- dape.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dape.el b/dape.el index 0e9a767111..d1c2f251d1 100644 --- a/dape.el +++ b/dape.el @@ -2651,6 +2651,21 @@ CONN is inferred by either last stopped or last created connection." (dape--update conn 'variables nil) (dape--repl-insert (concat result "\n")))))) +(defun dape-restart-frame (conn stack-id) + "Restart frame STACK-ID for adapter CONN." + (interactive + (let ((conn (dape--live-connection 'stopped t))) + (call-interactively #'dape-select-stack) + (list conn (dape--stack-id conn)))) + (let* ((current-frame (progn (dape-select-stack conn stack-id) + (dape--current-stack-frame conn))) + (frame-id (plist-get current-frame :id))) + (if (dape--capable-p conn :supportsRestartFrame) + (dape--with-request-bind (_body error) + (dape-request conn :restartFrame `(:frameId ,frame-id)) + (if error (dape--warn "Failed to restart stack frame: %s" error) + (dape--repl-insert "Stack frame restarted\n")))))) + ;;;###autoload (defun dape (config &optional skip-compile) "Start a debugging session using CONFIG.