diff --git a/modules/lang/crystal/config.el b/modules/lang/crystal/config.el index 255f1a89d..97070ddb4 100644 --- a/modules/lang/crystal/config.el +++ b/modules/lang/crystal/config.el @@ -1,6 +1,9 @@ ;;; lang/crystal/config.el -*- lexical-binding: t; -*- (after! crystal-mode + (when (executable-find "crystal") + (set-formatter! 'crystal-mode '("crystal" "tool" "format" "-") :modes '(crystal-mode))) + (set-lookup-handlers! 'crystal-mode :definition #'crystal-def-jump :references #'crystal-tool-imp) diff --git a/modules/lang/crystal/doctor.el b/modules/lang/crystal/doctor.el index b2f68f86e..23eb9171a 100644 --- a/modules/lang/crystal/doctor.el +++ b/modules/lang/crystal/doctor.el @@ -3,3 +3,6 @@ (unless (executable-find "icr") (warn! "Couldn't find icr. REPL will not work")) + +(unless (executable-find "crystal") + (error! "Couldn't find crystal. Most language features will not work."))