From 7bdf8802a5e3ce2cc40c12310e6250ba84a67eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ellis=20Keny=C5=91?= Date: Tue, 16 Aug 2022 21:24:57 +0100 Subject: [PATCH] feat(format): add :lang racket formatter --- modules/lang/racket/config.el | 1 + modules/lang/racket/doctor.el | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/modules/lang/racket/config.el b/modules/lang/racket/config.el index 2d890879b..ab5f90489 100644 --- a/modules/lang/racket/config.el +++ b/modules/lang/racket/config.el @@ -21,6 +21,7 @@ :dot ".") (set-rotate-patterns! 'racket-mode :symbols '(("#true" "#false"))) + (set-formatter! 'raco-fmt '("raco" "fmt") :modes '(racket-mode)) (add-hook! 'racket-mode-hook #'rainbow-delimiters-mode diff --git a/modules/lang/racket/doctor.el b/modules/lang/racket/doctor.el index cabeb0d55..6348e7406 100644 --- a/modules/lang/racket/doctor.el +++ b/modules/lang/racket/doctor.el @@ -9,3 +9,8 @@ (unless (executable-find "raco") (warn! "Could not find raco executable; commands for install packages and build libraries will not work.")) + +(when (modulep! :editor format) + (unless (and (executable-find "raco") + (eq 0 (call-process-shell-command "raco fmt --help" nil nil))) + (warn! "Couldn't find raco fmt. Formatting will be disabled.")))