Skip to content

Commit 606595c

Browse files
committed
Fix flycheck integration both when exists and not
- Flycheck executable should now be `flycheck-solidity-checker-executable` with the latest flycheck versions - If flycheck is not there it's not sufficient to simply do `(when (require 'flycheck nil 'noerror) .. )`. You also have to wrap in `(eval-when-compile ... )`. This should address #8 and the errors the users are seeing there.
1 parent aaae7a5 commit 606595c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

solidity-mode.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Highlight the 1st result."
384384
(run-hooks 'solidity-mode-hook))
385385

386386
;;; --- interface with flycheck if existing ---
387-
(when (require 'flycheck nil 'noerror)
387+
(when (eval-when-compile (require 'flycheck nil 'noerror))
388388
;; add dummy source-inplace definition to avoid errors
389389
(defvar source-inplace t)
390390
;; add a solidity mode callback to set the executable of solc for flycheck
@@ -398,7 +398,7 @@ Highlight the 1st result."
398398
:predicate (lambda () (eq major-mode 'solidity-mode)))
399399
(add-to-list 'flycheck-checkers 'solidity-checker)
400400
(add-hook 'solidity-mode-hook
401-
(lambda () (setq flycheck-solidity-executable solidity-solc-path))))
401+
(lambda () (setq flycheck-solidity-checker-executable solidity-solc-path))))
402402

403403
(provide 'solidity-mode)
404404
;;; solidity-mode.el ends here

0 commit comments

Comments
 (0)