featurep! will be renamed modulep! in the future, so it's been deprecated. They have identical interfaces, and can be replaced without issue. featurep! was never quite the right name for this macro. It implied that it had some connection to featurep, which it doesn't (only that it was similar in purpose; still, Doom modules are not features). To undo such implications and be consistent with its namespace (and since we're heading into a storm of breaking changes with the v3 release anyway), now was the best opportunity to begin the transition.
26 lines
1.1 KiB
EmacsLisp
26 lines
1.1 KiB
EmacsLisp
;;; lang/java/+lsp.el -*- lexical-binding: t; -*-
|
|
;;;###if (and (modulep! +lsp) (not (modulep! :tools lsp +eglot)))
|
|
|
|
(use-package! lsp-java
|
|
:after lsp-mode
|
|
:preface
|
|
(setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace"))
|
|
(add-hook 'java-mode-local-vars-hook #'lsp! 'append)
|
|
:config
|
|
(when (modulep! :tools debugger +lsp)
|
|
(setq lsp-jt-root (concat lsp-java-server-install-dir "java-test/server/")
|
|
dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar"))))
|
|
|
|
|
|
(use-package! dap-java
|
|
:when (modulep! :tools debugger +lsp)
|
|
:commands dap-java-run-test-class dap-java-debug-test-class
|
|
:init
|
|
(map! :after cc-mode ; where `java-mode' is defined
|
|
:map java-mode-map
|
|
:localleader
|
|
(:prefix ("t" . "Test")
|
|
:desc "Run test class or method" "t" #'+java/run-test
|
|
:desc "Run all tests in class" "a" #'dap-java-run-test-class
|
|
:desc "Debug test class or method" "d" #'+java/debug-test
|
|
:desc "Debug all tests in class" "D" #'dap-java-debug-test-class)))
|