feat(format): add :lang crystal formatter

This commit is contained in:
Ellis Kenyő 2022-08-15 07:34:52 +01:00 committed by Ellis Kenyo
parent 4d51e46c9f
commit 078bf0dd2e
No known key found for this signature in database
GPG key ID: 298BE5D997EBAA02
2 changed files with 6 additions and 0 deletions

View file

@ -1,6 +1,9 @@
;;; lang/crystal/config.el -*- lexical-binding: t; -*- ;;; lang/crystal/config.el -*- lexical-binding: t; -*-
(after! crystal-mode (after! crystal-mode
(when (executable-find "crystal")
(set-formatter! 'crystal-mode '("crystal" "tool" "format" "-") :modes '(crystal-mode)))
(set-lookup-handlers! 'crystal-mode (set-lookup-handlers! 'crystal-mode
:definition #'crystal-def-jump :definition #'crystal-def-jump
:references #'crystal-tool-imp) :references #'crystal-tool-imp)

View file

@ -3,3 +3,6 @@
(unless (executable-find "icr") (unless (executable-find "icr")
(warn! "Couldn't find icr. REPL will not work")) (warn! "Couldn't find icr. REPL will not work"))
(unless (executable-find "crystal")
(error! "Couldn't find crystal. Most language features will not work."))