[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape ed37a0cd5b 025/123: Add exception breakpoints
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape ed37a0cd5b 025/123: Add exception breakpoints |
Date: |
Tue, 5 Dec 2023 03:57:57 -0500 (EST) |
branch: externals/dape
commit ed37a0cd5b0b5de05c2d5081e9b8d02778e78e5e
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Add exception breakpoints
---
README.org | 1 -
dape.el | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index b10295249e..94e2ee6dc8 100644
--- a/README.org
+++ b/README.org
@@ -189,7 +189,6 @@ See
[[https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/]
+ More options for indicator placement
+ Improving completion in REPL
+ Usage of "setVariable" inside of ~*dape-info*~ buffer
-+ Exception breakpoints in ~*dape-info*~ buffer
+ Fleshed out memory reader with auto reload and write functionality
+ Individual thread controls
+ Variable values displayed in source buffer, this seams to require
integration with lsp-mode and eglot
diff --git a/dape.el b/dape.el
index cfebf93497..1b217bdf97 100644
--- a/dape.el
+++ b/dape.el
@@ -200,6 +200,7 @@ The hook is run with one argument, the compilation buffer."
(defvar dape--threads nil)
(defvar dape--stack-pointers nil)
(defvar dape--breakpoints nil)
+(defvar dape--exceptions nil)
(defvar dape--watched nil)
(defvar dape--server-process nil)
(defvar dape--process nil)
@@ -212,6 +213,7 @@ The hook is run with one argument, the compilation buffer."
(defvar dape--stack-widget nil)
(defvar dape--threads-widget nil)
(defvar dape--breakpoints-widget nil)
+(defvar dape--exceptions-widget nil)
(defvar dape--widget-guard nil)
(defvar dape--repl-insert-text-guard nil)
@@ -581,6 +583,46 @@ The hook is run with one argument, the compilation buffer."
cb)
(funcall cb process)))
+(defun dape--set-exception-breakpoints (process cb)
+ (if dape--exceptions
+ (dape-request process
+ "setExceptionBreakpoints"
+ (list
+ :filters
+ (cl-map 'vector
+ (lambda (exception)
+ (plist-get exception :filter))
+
+ (seq-filter (lambda (exception)
+ (plist-get exception :enabled))
+ dape--exceptions)))
+ cb)
+ (funcall cb process)))
+
+(defun dape--configure-exceptions (process cb)
+ (setq dape--exceptions
+ (cl-map 'list
+ (lambda (exception)
+ (let ((stored-exception
+ (seq-find (lambda (stored-exception)
+ (equal (plist-get exception :filter)
+ (plist-get stored-exception
:filter)))
+ dape--exceptions)))
+ (cond
+ (stored-exception
+ (plist-put exception :enabled
+ (plist-get stored-exception :enabled)))
+ ;; new exception
+ (t
+ (plist-put exception :enabled
+ (plist-get exception :default))))))
+ (plist-get dape--capabilities
+ :exceptionBreakpointFilters)))
+ (dape--set-exception-breakpoints process
+ (dape--callback
+ (dape--info-update-widget
dape--exceptions-widget)
+ (funcall cb process))))
+
(defun dape--configure-breakpoints (process cb)
(dape--clean-breakpoints)
(if-let ((counter 0)
@@ -737,10 +779,13 @@ The hook is run with one argument, the compilation
buffer."
(cl-defmethod dape-handle-event (process (_event (eql initialized)) _body)
(dape--update-state "initialized")
- (dape--configure-breakpoints
+ (dape--configure-exceptions
process
(dape--callback
- (dape--configuration-done process))))
+ (dape--configure-breakpoints
+ process
+ (dape--callback
+ (dape--configuration-done process))))))
(cl-defmethod dape-handle-event (_process (_event (eql process)) body)
(let ((start-method (format "%sed"
@@ -1675,6 +1720,22 @@ Watched symbols are displayed in *dape-info* buffer.
:value (dape--format-file-line file line)))))
dape--breakpoints)))
+(defun dape--expand-exceptions-widget (_)
+ (mapcar (lambda (exception)
+ (widget-convert
+ 'toggle
+ :format (format "%s %%[%%v%%]\n"
+ (plist-get exception :label))
+ :value (plist-get exception :enabled)
+ :action (lambda (&rest args)
+ (plist-put exception :enabled
+ (not (plist-get exception :enabled)))
+ (dape--set-exception-breakpoints
+ (dape--live-process)
+ (dape--callback
+ (dape--info-update-widget
dape--exceptions-widget))))))
+ dape--exceptions))
+
(defun dape--info-press-widget-at-line (predicate-p)
(save-excursion
(if (funcall predicate-p (widget-at))
@@ -1700,7 +1761,7 @@ Depending on line in *dape-info* buffer."
(dape--info-press-widget-at-line
(lambda (widget)
(memq (widget-type widget)
- '(file-link link)))))
+ '(file-link link toggle)))))
(defun dape-info-tree-dwim ()
"Toggle tree expansion in *dape-info* buffer."
@@ -1787,7 +1848,14 @@ Buffer contains debug session information."
:path '("Breakpoints")
:open t
:expander-p 'identity ;; Always expand
- :expander 'dape--expand-breakpoints-widget))
+ :expander 'dape--expand-breakpoints-widget)
+ dape--exceptions-widget
+ (widget-create 'dape--tree-widget
+ :tag (propertize "Exceptions" 'face 'bold)
+ :path '("Exceptions")
+ :open t
+ :expander-p 'identity ;; Always expand
+ :expander 'dape--expand-exceptions-widget))
(widget-setup))
(setq window (display-buffer buffer
'((display-buffer-in-side-window)
- [elpa] branch externals/dape created (now b52882f627), ELPA Syncer, 2023/12/05
- [elpa] externals/dape 3e15266d78 030/123: Remove function symbols from config options diff, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 813ace9e69 033/123: Fix vector options eval, ELPA Syncer, 2023/12/05
- [elpa] externals/dape e804aca510 008/123: Readme fixups, ELPA Syncer, 2023/12/05
- [elpa] externals/dape b7f68f1b96 021/123: Update readme with a bit more helpful path example, ELPA Syncer, 2023/12/05
- [elpa] externals/dape c7c085a94a 012/123: Added roadmap, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 2376cf5400 010/123: Resolve symbols in config evaluation, ELPA Syncer, 2023/12/05
- [elpa] externals/dape ed37a0cd5b 025/123: Add exception breakpoints,
ELPA Syncer <=
- [elpa] externals/dape 8418a68442 026/123: Fix repl faces, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 815a880f48 027/123: Rename dape input vars, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 4eb75e39b2 031/123: Small readme fixup, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 04aabf1862 041/123: Update screenshots, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 95d52ea585 044/123: Fix parsing of codelldb adapter output on windows #1, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 3d800b349e 045/123: Add godot example config, ELPA Syncer, 2023/12/05
- [elpa] externals/dape b42b7def86 046/123: Fix timers when repl buffer is not available, ELPA Syncer, 2023/12/05
- [elpa] externals/dape efcfc93003 047/123: Fix duplicate variable overlays, ELPA Syncer, 2023/12/05
- [elpa] externals/dape cacddbb8e7 057/123: Improve error printout and do a better job of validating config, ELPA Syncer, 2023/12/05
- [elpa] externals/dape ccb6060b55 067/123: Add disconnect functionality and PID helper for attach requests, ELPA Syncer, 2023/12/05