lang/java: refactor commands out into autoloads

This commit is contained in:
Henrik Lissner 2020-05-08 05:58:25 -04:00
parent b74abebffa
commit d1b3021304
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 27 additions and 23 deletions

View file

@ -0,0 +1,20 @@
;;; lang/java/autoload/lsp.el -*- lexical-binding: t; -*-
;;;###if (featurep! :tools debugger +lsp)
;;;###autoload
(defun +java/run-test ()
"Runs test at point.
If in a method, runs the test method, otherwise runs the entire test class."
(interactive)
(condition-case nil
(dap-java-run-test-method)
(user-error (dap-java-run-test-class))))
;;;###autoload
(defun +java/debug-test ()
"Runs test at point in a debugger.
If in a method, runs the test method, otherwise runs the entire test class."
(interactive)
(condition-case nil
(call-interactively #'dap-java-debug-test-method)
(user-error (call-interactively #'dap-java-debug-test-class))))