Configure dap-mode debugging for Java

This commit is contained in:
Jeremy Dormitzer 2022-04-20 15:53:36 -04:00
parent 667ed940ef
commit 344ab6b686
2 changed files with 24 additions and 0 deletions

View File

@ -62,6 +62,13 @@
:custom
(lsp-ui-doc-show-with-cursor t))
;; Integrated debugger
(use-package dap-mode
:commands (dap-debug dap-debug-edit-template dap-mode)
:config
(add-hook 'dap-stopped-hook
(lambda (arg) (call-interactively #'dap-hydra))))
;; Some compilation-mode conveniences
(use-package compile
:straight (:type built-in)

View File

@ -7,6 +7,23 @@
(use-package lsp-java
:hook (java-mode . lsp-deferred))
(defvar java-debug-map (make-sparse-keymap))
(general-def java-mode-map
"C-c d" '(:keymap java-debug-map :which-key "debug"))
(general-def java-debug-map
"d" 'dap-java-debug
"t" 'dap-java-debug-test-method
"c" 'dap-java-debug-test-class)
(with-eval-after-load 'dap-java
(setq dap-java-test-additional-args '("-n" "\".*(Test|IT).*\"")))
(defun jdormit-java-setup ()
(require 'dap-java)
(dap-mode))
(add-hook 'java-mode-hook 'jdormit-java-setup)
(use-package protobuf-mode)
(provide 'init-java)