[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape e314b97bc1 016/123: Refactor update and update ui
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape e314b97bc1 016/123: Refactor update and update ui |
Date: |
Tue, 5 Dec 2023 03:57:56 -0500 (EST) |
branch: externals/dape
commit e314b97bc1717f11f3052a363358dc6d485ef202
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Refactor update and update ui
---
dape.el | 75 +++++++++++++++++++++++++++++++----------------------------------
1 file changed, 36 insertions(+), 39 deletions(-)
diff --git a/dape.el b/dape.el
index cb4c00e8ce..3bc3ab1bab 100644
--- a/dape.el
+++ b/dape.el
@@ -671,14 +671,16 @@ The hook is run with one argument, the compilation
buffer."
(funcall cb process))))
(funcall cb process)))
-(defun dape--update (process)
+(defun dape--update (process &optional skip-clear-stack-frames)
(let ((current-thread (dape--current-thread)))
- (dolist (thread dape--threads)
- (plist-put thread :stackFrames nil))
+ (unless skip-clear-stack-frames
+ (dolist (thread dape--threads)
+ (plist-put thread :stackFrames nil)))
+ (dolist (watched dape--watched)
+ (plist-put watched :fetched nil))
(dape--stack-trace process
- current-thread
- (dape--callback
- (dape--update-ui)))))
+ current-thread
+ (dape--callback (dape--update-ui process)))))
;;; Incoming requests
@@ -1303,7 +1305,7 @@ Watched symbols are displayed in *dape-info* buffer.
(delete-overlay overlay))
(setq dape--stack-pointers nil))
-(defun dape--place-stack-pointers (_process thread)
+(defun dape--place-stack-pointers (thread)
(when-let ((stopped-event-thread-p (eq dape--thread-id
(plist-get thread :id)))
(current-stack-frame (dape--current-stack-frame))
@@ -1428,13 +1430,14 @@ Watched symbols are displayed in *dape-info* buffer.
(defconst dape--info-variables-fetch-depth 4)
(defun dape--info-fetch-variables-1 (process object path cb)
- (let ((objects (seq-filter (lambda (object)
- (and (length< path
dape--info-variables-fetch-depth)
- (gethash (cons (plist-get object :name)
- path)
- dape--tree-widget-open-p)))
- (or (plist-get object :scopes)
- (plist-get object :variables))))
+ (let ((objects
+ (seq-filter (lambda (object)
+ (and (length< path dape--info-variables-fetch-depth)
+ (gethash (cons (plist-get object :name)
+ path)
+ dape--tree-widget-open-p)))
+ (or (plist-get object :scopes)
+ (plist-get object :variables))))
(requests 0))
(if objects
(dolist (object objects)
@@ -1452,16 +1455,16 @@ Watched symbols are displayed in *dape-info* buffer.
(funcall cb process)))))))
(funcall cb process))))
-(defun dape--update-scope (process)
+(defun dape--info-update-scope-widget (process)
(dape--scopes process
- (dape--current-stack-frame)
- (dape--callback
- (dape--info-fetch-variables-1 process
- (dape--current-stack-frame)
- '("Variables")
- (dape--callback
- (dape--info-update-widget
- dape--scopes-widget))))))
+ (dape--current-stack-frame)
+ (dape--callback
+ (dape--info-fetch-variables-1 process
+ (dape--current-stack-frame)
+ '("Variables")
+ (dape--callback
+ (dape--info-update-widget
+ dape--scopes-widget))))))
(defun dape--expand-threads (_)
(mapcar (lambda (thread)
@@ -1480,7 +1483,7 @@ Watched symbols are displayed in *dape-info* buffer.
:action (lambda (widget &rest _)
(setq dape--thread-id
(widget-get widget :id))
- (dape--update-ui))
+ (dape--update (dape--live-process) t))
:tag (plist-get thread :name)))
dape--threads))
@@ -1519,7 +1522,7 @@ Watched symbols are displayed in *dape-info* buffer.
:action (lambda (widget &rest _)
(setq dape--stack-id
(widget-get widget :id))
- (dape--update-ui))
+ (dape--update (dape--live-process) t))
:tag (propertize (plist-get stack-frame :name)
'face 'font-lock-function-name-face)))
(plist-get current-thread :stackFrames)))))
@@ -2081,21 +2084,15 @@ Buffer contains debug session information."
;;; UI
-(defun dape--update-ui ()
+(defun dape--update-ui (process)
(dape--remove-stack-pointers)
- (dolist (watched dape--watched)
- (plist-put watched :fetched nil))
- (when-let ((process (dape--live-process))
- (current-thread (dape--current-thread)))
- (dape--stack-trace process
- current-thread
- (dape--callback
- (dape--place-stack-pointers process current-thread)
- (dape--info-update-widget dape--threads-widget
- dape--stack-widget
- dape--watched-widget
- dape--breakpoints-widget)
- (dape--update-scope process)))))
+ (when-let ((current-thread (dape--current-thread)))
+ (dape--place-stack-pointers current-thread))
+ (dape--info-update-widget dape--threads-widget
+ dape--stack-widget
+ dape--watched-widget
+ dape--breakpoints-widget)
+ (dape--info-update-scope-widget process))
(defun dape--update-state (msg)
(setq dape--state msg)
- [elpa] externals/dape 6c501bfbc9 004/123: Fix watch dwim use symbol at point, (continued)
- [elpa] externals/dape 6c501bfbc9 004/123: Fix watch dwim use symbol at point, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 96b1815ed3 001/123: Initial commit, ELPA Syncer, 2023/12/05
- [elpa] externals/dape a21992c208 002/123: Add screenshot, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 6907fade6a 003/123: Fixup readme, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 572f2b2976 005/123: Fix bugs section, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 32cbd92a76 007/123: Add straight installation to readme, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 1bd018e477 015/123: Update formatting in roadmap section, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 2d4c0e6748 022/123: Add file and line to stack in info buffer, ELPA Syncer, 2023/12/05
- [elpa] externals/dape d896720cc1 011/123: Add projectile configuration in readme, ELPA Syncer, 2023/12/05
- [elpa] externals/dape c780c6f1e2 013/123: Fix crash when % is present in log and expression breakpoints, ELPA Syncer, 2023/12/05
- [elpa] externals/dape e314b97bc1 016/123: Refactor update and update ui,
ELPA Syncer <=
- [elpa] externals/dape 480bcd14f8 017/123: Improve REPL welcome message, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 57d3f6e1ff 024/123: Fix typo, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 20a8e99c24 018/123: Fix indentation, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 1ed319ba5f 020/123: Reword repl welcome message, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 3e51a71f52 034/123: Fixup readme, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 60283647ff 035/123: Fixup suggestions from emacs-devel, ELPA Syncer, 2023/12/05
- [elpa] externals/dape ffaa4278cd 036/123: Fix checkdoc issues, ELPA Syncer, 2023/12/05
- [elpa] externals/dape de1508f4b3 037/123: Change to old style of keymap define with defvar, ELPA Syncer, 2023/12/05
- [elpa] externals/dape ee2aaad60f 038/123: Invoke customize-variable if dape-configs is null, ELPA Syncer, 2023/12/05
- [elpa] externals/dape a23bcb8e66 040/123: Add naively inline variable overlays, ELPA Syncer, 2023/12/05