Get fixed.

See ab3376869
This commit is contained in:
Henrik Lissner 2020-08-11 19:21:48 -04:00
parent ab3376869d
commit 03162466c6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 14 additions and 10 deletions

View file

@ -2,21 +2,25 @@
;;;###if (featurep! +lsp)
(use-package! lsp-java
:commands dap-java-run-test-class dap-java-debug-test-class
:after lsp-clients
:preface
(setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace"))
(add-hook 'java-mode-local-vars-hook #'lsp!)
(map! :when (featurep! :tools debugger +lsp)
:after cc-mode ; where `java-mode' is defined
:config
(when (featurep! :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 (featurep! :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))
:config
(when (featurep! :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"))))
:desc "Debug all tests in class" "D" #'dap-java-debug-test-class)))

View file

@ -6,7 +6,7 @@
"Runs test at point.
If in a method, runs the test method, otherwise runs the entire test class."
(interactive)
(require 'lsp-java)
(require 'dap-java)
(condition-case nil
(dap-java-run-test-method)
(user-error (dap-java-run-test-class))))
@ -16,7 +16,7 @@ If in a method, runs the test method, otherwise runs the entire test class."
"Runs test at point in a debugger.
If in a method, runs the test method, otherwise runs the entire test class."
(interactive)
(require 'lsp-java)
(require 'dap-java)
(condition-case nil
(call-interactively #'dap-java-debug-test-method)
(user-error (call-interactively #'dap-java-debug-test-class))))