[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape 552683b9a8 04/10: Add overlay description for exce
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape 552683b9a8 04/10: Add overlay description for exception errors |
Date: |
Fri, 12 Jan 2024 10:04:10 -0500 (EST) |
branch: externals/dape
commit 552683b9a8dbed539802edbb3f41102091699c89
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Add overlay description for exception errors
---
dape.el | 39 +++++++++++++++++++++++++++++++++------
1 file changed, 33 insertions(+), 6 deletions(-)
diff --git a/dape.el b/dape.el
index 68b7e87378..3ad8c824ee 100644
--- a/dape.el
+++ b/dape.el
@@ -506,12 +506,17 @@ The hook is run with one argument, the compilation
buffer."
:height 0.85 :box (:line-width -1)))
"Face used to display conditional breakpoints.")
+(defface dape-exception-description-face
+ '((t :inherit (warning)
+ :height 0.85 :box (:line-width -1)))
+ "Face used to display exception descriptions inline.")
+
(defface dape-breakpoint-face
'((t :inherit (font-lock-keyword-face)))
"Face used to display breakpoint overlays.")
(defface dape-stack-trace
- '((t :inherit (highlight) :extend t))
+ '((t :inherit (default) :extend t))
"Face used to display stack trace overlays.")
(defface dape-stack-trace-pointer
@@ -957,6 +962,9 @@ If NOWARN does not error on no active process."
(state
:accessor dape--state :initform nil
:documentation "Session state.")
+ (exception-description
+ :accessor dape--exception-description :initform nil
+ :documentation "Exception description.")
(initialized-p
:accessor dape--initialized-p :initform nil
:documentation "If connection has been initialized.")
@@ -1507,14 +1515,14 @@ Sets `dape--thread-id' from BODY and invokes ui refresh
with
(plist-get body :allThreadsStopped)
(dape--callback
(dape--update conn)))
- (when-let ((texts
+ (if-let (((equal "exception" (plist-get body :reason)))
+ (texts
(seq-filter 'stringp
(list (plist-get body :text)
(plist-get body :description)))))
- (dape--repl-message (mapconcat 'identity texts "\n")
- (when (equal "exception"
- (plist-get body :reason))
- 'error)))
+ (setf (dape--exception-description conn)
+ (mapconcat 'identity texts ": "))
+ (setf (dape--exception-description conn) nil))
(run-hooks 'dape-on-stopped-hooks))
(cl-defmethod dape-handle-event (conn (_event (eql continued)) body)
@@ -2281,11 +2289,16 @@ See `dape--callback' for expected CB signature."
(defvar dape--stack-position (make-marker)
"Dape stack position for marker `overlay-arrow-variable-list'.")
+(defvar dape--stack-position-overlay nil
+ "Dape stack position overlay.")
+
(defun dape--remove-stack-pointers ()
"Remove stack pointer marker."
(when-let ((buffer (marker-buffer dape--stack-position)))
(with-current-buffer buffer
(dape--remove-eldoc-hook)))
+ (when (overlayp dape--stack-position-overlay)
+ (delete-overlay dape--stack-position-overlay))
(set-marker dape--stack-position nil))
(defun dape--update-stack-pointers (conn &optional skip-stack-pointer-flash)
@@ -2304,6 +2317,20 @@ If SKIP-STACK-POINTER-FLASH is non nil refrain from
flashing line."
(dape--add-eldoc-hook)
(save-excursion
(goto-char (marker-position marker))
+ (setq dape--stack-position-overlay
+ (let ((ov
+ (make-overlay (line-beginning-position)
+ (line-beginning-position 2))))
+ (overlay-put ov 'face 'dape-stack-trace)
+ (when-let ((exception-description
+ (dape--exception-description conn)))
+ (overlay-put ov 'after-string
+ (concat
+ (propertize exception-description
+ 'face
+
'dape-exception-description-face)
+ "\n")))
+ ov))
(set-marker dape--stack-position
(line-beginning-position))))))))
- [elpa] externals/dape updated (4393b10a53 -> 3673a55dd3), ELPA Syncer, 2024/01/12
- [elpa] externals/dape 2b54df1d25 02/10: Fix startDebugging request for debugpy process start, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 3673a55dd3 10/10: Fix stacktrace face, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 3d01c5f3b6 09/10: Add filename completion to read config, ELPA Syncer, 2024/01/12
- [elpa] externals/dape d730e3f4f2 06/10: Improve look of config barf on error, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 7e184d193a 03/10: Add option to align variables table, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 552683b9a8 04/10: Add overlay description for exception errors,
ELPA Syncer <=
- [elpa] externals/dape 043cf44d09 07/10: `dape-info' now toggles buffers when called as a command, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 400082bc9b 01/10: Fix removal of log and expression breakpoints, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 371e88daec 08/10: Fix issue where stack shows stack trace even if continued, ELPA Syncer, 2024/01/12
- [elpa] externals/dape 1ec1b243c9 05/10: Improve usability of goto breakpoint in info buffer, ELPA Syncer, 2024/01/12