mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
lang/java: fail meghanada-mode gracefully if java is absent
This commit is contained in:
@ -9,11 +9,20 @@
|
|||||||
meghanada-use-flycheck (featurep! :checkers syntax)
|
meghanada-use-flycheck (featurep! :checkers syntax)
|
||||||
meghanada-use-eldoc t
|
meghanada-use-eldoc t
|
||||||
meghanada-use-auto-start t)
|
meghanada-use-auto-start t)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(set-lookup-handlers! 'java-mode
|
(set-lookup-handlers! 'java-mode
|
||||||
:definition #'meghanada-jump-declaration
|
:definition #'meghanada-jump-declaration
|
||||||
:references #'meghanada-reference)
|
:references #'meghanada-reference)
|
||||||
|
|
||||||
|
(defadvice! +java-meghanada-fail-gracefully-a (orig-fn &rest args)
|
||||||
|
"Toggle `meghanada-mode'. Fail gracefully if java is unavailable."
|
||||||
|
:around #'meghanada-mode
|
||||||
|
(if (executable-find meghanada-java-path)
|
||||||
|
(apply orig-fn args)
|
||||||
|
(message "Can't find %S binary. Is java installed? Aborting `meghanada-mode'."
|
||||||
|
meghanada-java-path)))
|
||||||
|
|
||||||
(map! :localleader
|
(map! :localleader
|
||||||
:map java-mode-map
|
:map java-mode-map
|
||||||
(:prefix ("r" . "refactor")
|
(:prefix ("r" . "refactor")
|
||||||
|
Reference in New Issue
Block a user