Skip to content

Commit

Permalink
Check for existence of Java executable before activating.
Browse files Browse the repository at this point in the history
  • Loading branch information
mavit committed Nov 7, 2021
1 parent 4fcf88d commit b6d0b15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flycheck-languagetool.el
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,18 @@ CALLBACK is passed from Flycheck."
"Can the Flycheck LanguageTool checker be enabled?"
(or (and flycheck-languagetool-server-jar
(not (string= "" flycheck-languagetool-server-jar))
(file-exists-p flycheck-languagetool-server-jar))
(file-exists-p flycheck-languagetool-server-jar)
(executable-find "java"))
(and flycheck-languagetool-url
(not (string= "" flycheck-languagetool-url)))))

(defun flycheck-languagetool--verify (_checker)
"Verify proper configuration of Flycheck _CHECKER `languagetool'."
(list
(flycheck-verification-result-new
:label "Java executable"
:message (or (executable-find "java") "Not found")
:face (if (executable-find "java") 'success '(bold warning)))
(flycheck-verification-result-new
:label "LanguageTool server JAR"
:message
Expand Down

0 comments on commit b6d0b15

Please sign in to comment.