parent
ab3376869d
commit
03162466c6
2 changed files with 14 additions and 10 deletions
|
@ -2,21 +2,25 @@
|
||||||
;;;###if (featurep! +lsp)
|
;;;###if (featurep! +lsp)
|
||||||
|
|
||||||
(use-package! lsp-java
|
(use-package! lsp-java
|
||||||
:commands dap-java-run-test-class dap-java-debug-test-class
|
|
||||||
:after lsp-clients
|
:after lsp-clients
|
||||||
:preface
|
:preface
|
||||||
(setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace"))
|
(setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace"))
|
||||||
(add-hook 'java-mode-local-vars-hook #'lsp!)
|
(add-hook 'java-mode-local-vars-hook #'lsp!)
|
||||||
(map! :when (featurep! :tools debugger +lsp)
|
:config
|
||||||
:after cc-mode ; where `java-mode' is defined
|
(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
|
:map java-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
(:prefix ("t" . "Test")
|
(:prefix ("t" . "Test")
|
||||||
:desc "Run test class or method" "t" #'+java/run-test
|
:desc "Run test class or method" "t" #'+java/run-test
|
||||||
:desc "Run all tests in class" "a" #'dap-java-run-test-class
|
:desc "Run all tests in class" "a" #'dap-java-run-test-class
|
||||||
:desc "Debug test class or method" "d" #'+java/debug-test
|
:desc "Debug test class or method" "d" #'+java/debug-test
|
||||||
:desc "Debug all tests in class" "D" #'dap-java-debug-test-class))
|
: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"))))
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"Runs test at point.
|
"Runs test at point.
|
||||||
If in a method, runs the test method, otherwise runs the entire test class."
|
If in a method, runs the test method, otherwise runs the entire test class."
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'lsp-java)
|
(require 'dap-java)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(dap-java-run-test-method)
|
(dap-java-run-test-method)
|
||||||
(user-error (dap-java-run-test-class))))
|
(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.
|
"Runs test at point in a debugger.
|
||||||
If in a method, runs the test method, otherwise runs the entire test class."
|
If in a method, runs the test method, otherwise runs the entire test class."
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'lsp-java)
|
(require 'dap-java)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(call-interactively #'dap-java-debug-test-method)
|
(call-interactively #'dap-java-debug-test-method)
|
||||||
(user-error (call-interactively #'dap-java-debug-test-class))))
|
(user-error (call-interactively #'dap-java-debug-test-class))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue