[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape ebd9ebf6a8 074/123: Default to "sensible" values i
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape ebd9ebf6a8 074/123: Default to "sensible" values in `dape-config' when missing |
Date: |
Tue, 5 Dec 2023 03:58:02 -0500 (EST) |
branch: externals/dape
commit ebd9ebf6a84674091743b42e13c5f8a251c3a777
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Default to "sensible" values in `dape-config' when missing
---
dape.el | 48 +++++++++++++++++++++++-------------------------
1 file changed, 23 insertions(+), 25 deletions(-)
diff --git a/dape.el b/dape.el
index 336c73d4a6..7fa620a50e 100644
--- a/dape.el
+++ b/dape.el
@@ -727,20 +727,16 @@ See `dape--callback' for expected function signature."
(defun dape--launch-or-attach (process)
"Send launch or attach request to PROCESS.
Uses `dape--config' to derive type and to construct request."
- (if-let ((request (plist-get dape--config :request)))
- (dape-request process
- request
- (append
- (cl-loop for (key value) on dape--config by 'cddr
- when (keywordp key)
- append (list key value))
- (plist-get dape--config 'start-debugging))
- (dape--callback
- (when (plist-get dape--config 'start-debugging)
- (plist-put dape--config 'start-debugging nil))))
- (user-error "Need to specify request in config `%S'"
- dape--config)
- (dape-kill)))
+ (dape-request process
+ (or (plist-get dape--config :request) "launch")
+ (append
+ (cl-loop for (key value) on dape--config by 'cddr
+ when (keywordp key)
+ append (list key value))
+ (plist-get dape--config 'start-debugging))
+ (dape--callback
+ (when (plist-get dape--config 'start-debugging)
+ (plist-put dape--config 'start-debugging nil)))))
(defun dape--set-breakpoints (process buffer breakpoints &optional cb)
"Set BREAKPOINTS in BUFFER by send setBreakpoints request to PROCESS.
@@ -1167,6 +1163,7 @@ Starts a new process as per request of the debug adapter."
(let ((buffer (dape--get-buffer))
(default-directory (or (plist-get config 'command-cwd)
default-directory))
+ (host (or (plist-get config 'host) "localhost"))
(retries 30)
process)
(when (and (plist-get config 'command)
@@ -1191,7 +1188,7 @@ Starts a new process as per request of the debug adapter."
(setq process
(make-network-process :name (symbol-name name)
:buffer buffer
- :host (plist-get config 'host)
+ :host host
:coding 'utf-8-emacs-unix
:service (plist-get config 'port)
:sentinel 'dape--process-sentinel
@@ -1201,10 +1198,10 @@ Starts a new process as per request of the debug
adapter."
(setq retries (1- retries)))
(if (zerop retries)
(user-error "Unable to connect to server %s:%d"
- (plist-get config 'host)
+ host
(plist-get config 'port))
(dape--debug 'info "Connection to server established %s:%s"
- (plist-get config 'host) (plist-get config 'port)))
+ host (plist-get config 'port)))
(dape--setup process name config)))
(defun dape--start-single-session (name config)
@@ -1486,7 +1483,7 @@ Executes launch `dape-configs' with :program as \"bin\"."
(cond
((and (not skip-compile) (plist-get config 'compile))
(dape--compile name config))
- ((and (plist-get config 'host) (plist-get config 'port))
+ ((plist-get config 'port)
(dape--start-multi-session name config))
(t
(dape--start-single-session name config)))))
@@ -2606,13 +2603,14 @@ arrays [%S ...], if meant as an object replace (%S ...)
with (:%s ...)"
"Create a diff of config NAME and POST-EVAL config."
(let ((base-config (alist-get name dape-configs)))
(cl-loop for (key value) on post-eval by 'cddr
- unless (and
- ;; Does the key exist in `base-config'?
- (plist-member base-config key)
- ;; Has value changed?
- (equal (dape--config-eval-value (plist-get base-config
key)
- t)
- value))
+ unless (or (eq key 'modes) ;; Skip modes
+ (and
+ ;; Does the key exist in `base-config'?
+ (plist-member base-config key)
+ ;; Has value changed?
+ (equal (dape--config-eval-value (plist-get
base-config key)
+ t)
+ value)))
append (list key value))))
(defun dape--config-to-string (name post-eval-config)
- [elpa] externals/dape 2620078517 117/123: Improve error message on failed restart, (continued)
- [elpa] externals/dape 2620078517 117/123: Improve error message on failed restart, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 0f545358e2 118/123: Fix strange usage of add to watch in scope buffer, ELPA Syncer, 2023/12/05
- [elpa] externals/dape c3fb0ebc32 075/123: Remove `dape--name', ELPA Syncer, 2023/12/05
- [elpa] externals/dape bc17ae80ff 078/123: Fix debuggee cleanup, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 30b2695154 087/123: Cancel timeout timers on process kill, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 41cfcc3ce3 089/123: Variety of dape--tree-widget performance "hacks", ELPA Syncer, 2023/12/05
- [elpa] externals/dape b7c578992d 094/123: Fix unnecessary newline in stopped repl text, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 4c990a5769 110/123: Rename `dape-breakpoint-*' functions for discoverability, ELPA Syncer, 2023/12/05
- [elpa] externals/dape f02fc87e82 116/123: Fix fringe check when placing breakpoints, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 8cc8b262c1 059/123: Add custom formatting to dape-info variables, ELPA Syncer, 2023/12/05
- [elpa] externals/dape ebd9ebf6a8 074/123: Default to "sensible" values in `dape-config' when missing,
ELPA Syncer <=
- [elpa] externals/dape 5c62153574 042/123: Fix various customization types, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 3770a22b28 060/123: Cleanup before emacs exits #8, ELPA Syncer, 2023/12/05
- [elpa] externals/dape b27a7db84c 071/123: Add defcustom buffer actions to Dape buffers, ELPA Syncer, 2023/12/05
- [elpa] externals/dape f982879c17 080/123: Cleanup timeouts before restart, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 5f65524007 102/123: Fix REPL completions when process has never stopped #15, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 2831601925 014/123: Small README improvements, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 3a05121b02 019/123: Fix adapter examples, ELPA Syncer, 2023/12/05
- [elpa] externals/dape df0c2d8357 023/123: Require success to launch/attach after initialize, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 161501b4a5 029/123: Fix example in readme, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 819d4c39f9 028/123: Keep log and expression breakpoints when removing breakpoints, ELPA Syncer, 2023/12/05