From 03162466c65b1f53274d97fde4dc016b77020b53 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 11 Aug 2020 19:21:48 -0400 Subject: [PATCH] Fix fix for #3731 Get fixed. See ab3376869 --- modules/lang/java/+lsp.el | 20 ++++++++++++-------- modules/lang/java/autoload/lsp.el | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/lang/java/+lsp.el b/modules/lang/java/+lsp.el index cd36e7574..28dfe29e3 100644 --- a/modules/lang/java/+lsp.el +++ b/modules/lang/java/+lsp.el @@ -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))) diff --git a/modules/lang/java/autoload/lsp.el b/modules/lang/java/autoload/lsp.el index 847174f09..9ead99284 100644 --- a/modules/lang/java/autoload/lsp.el +++ b/modules/lang/java/autoload/lsp.el @@ -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))))