lang/java: fail meghanada-mode gracefully if java is absent
This commit is contained in:
parent
c77cebfef8
commit
b158215587
1 changed files with 9 additions and 0 deletions
|
@ -9,11 +9,20 @@
|
|||
meghanada-use-flycheck (featurep! :checkers syntax)
|
||||
meghanada-use-eldoc t
|
||||
meghanada-use-auto-start t)
|
||||
|
||||
:config
|
||||
(set-lookup-handlers! 'java-mode
|
||||
:definition #'meghanada-jump-declaration
|
||||
: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 java-mode-map
|
||||
(:prefix ("r" . "refactor")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue