emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dape 98c3865e56 13/13: Add `debugpy-module' default con


From: ELPA Syncer
Subject: [elpa] externals/dape 98c3865e56 13/13: Add `debugpy-module' default configuration
Date: Tue, 5 Mar 2024 18:57:52 -0500 (EST)

branch: externals/dape
commit 98c3865e565ca035b643e932ac5f025ea3e93186
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>

    Add `debugpy-module' default configuration
---
 dape.el | 54 ++++++++++++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 22 deletions(-)

diff --git a/dape.el b/dape.el
index e3f44606a4..64c34bbaa0 100644
--- a/dape.el
+++ b/dape.el
@@ -130,28 +130,38 @@
      :cwd "."
      :program "a.out"
      :MIMode ,(seq-find 'executable-find '("lldb" "gdb")))
-    (debugpy
-     modes (python-mode python-ts-mode)
-     ensure (lambda (config)
-              (dape-ensure-command config)
-              (let ((python
-                     (dape--config-eval-value (plist-get config 'command))))
-                (unless (zerop
-                         (call-process-shell-command
-                          (format "%s -c \"import debugpy.adapter\"" python)))
-                  (user-error "%s module debugpy is not installed" python))))
-     command "python"
-     command-args ("-m" "debugpy.adapter" "--host" "0.0.0.0" "--port" 
:autoport)
-     port :autoport
-     :request "launch"
-     :type "executable"
-     :cwd dape-cwd
-     :program dape-buffer-default
-     :args []
-     :justMyCode nil
-     :console "integratedTerminal"
-     :showReturnValue t
-     :stopAtEntry t)
+    ,@(let ((debugpy
+             `(modes (python-mode python-ts-mode)
+               ensure (lambda (config)
+                        (dape-ensure-command config)
+                        (let ((python (dape-config-get config 'command)))
+                          (unless (zerop
+                                   (call-process-shell-command
+                                    (format "%s -c \"import debugpy.adapter\"" 
python)))
+                            (user-error "%s module debugpy is not installed" 
python))))
+               command "python"
+               command-args ("-m" "debugpy.adapter" "--host" "0.0.0.0" 
"--port" :autoport)
+               port :autoport
+               :request "launch"
+               :type "python"
+               :cwd dape-cwd))
+            (common
+             `(:args []
+               :justMyCode nil
+               :console "integratedTerminal"
+               :showReturnValue t
+               :stopAtEntry t)))
+        `((debugpy ,@debugpy
+                   :program dape-buffer-default
+                   ,@common)
+          (debugpy-module ,@debugpy
+                          :module (lambda ()
+                                    (thread-first default-directory
+                                                  (directory-file-name)
+                                                  (file-name-split)
+                                                  (last)
+                                                  (car)))
+                          ,@common)))
     (dlv
      modes (go-mode go-ts-mode)
      ensure dape-ensure-command



reply via email to

[Prev in Thread] Current Thread [Next in Thread]