From 68955452a505fe8b481aa8b4836f8812824ce199 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 13 Jun 2024 13:49:30 -0400 Subject: [PATCH] Add dape for debugging --- emacs/.emacs.d/config/init-ide.el | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/emacs/.emacs.d/config/init-ide.el b/emacs/.emacs.d/config/init-ide.el index 2eedc68..794f94c 100644 --- a/emacs/.emacs.d/config/init-ide.el +++ b/emacs/.emacs.d/config/init-ide.el @@ -240,6 +240,33 @@ (eglot-confirm-server-initiated-edits nil) (eglot-connect-timeout nil)) +;; Debug adapter protocol +(use-package dape + :config + (add-to-list 'dape-configs + '(rdbg + modes (ruby-mode ruby-ts-mode) + ensure dape-ensure-command + command "bundle" + command-args ("exec" "rdbg" "-O" "--host" "0.0.0.0" "--port" :autoport "-c" "--" :-c) + fn (lambda (config) + (plist-put config 'command-args + (mapcar (lambda (arg) + (if (eq arg :-c) + (plist-get config '-c) + arg)) + (plist-get config 'command-args)))) + port :autoport + command-cwd dape-command-cwd + :type "Ruby" + ;; -- examples: + ;; rails server + ;; bundle exec ruby foo.rb + ;; bundle exec rake test + -c (lambda () + (format "ruby %s" + (or (dape-buffer-default) "")))))) + ;; Some compilation-mode conveniences (use-package compile :straight (:type built-in)