feat(format): add :lang scala formatter

This commit is contained in:
Ellis Kenyo 2023-07-24 19:43:58 +01:00
parent caa6b2bb3b
commit 3c96f33cb8
No known key found for this signature in database
GPG key ID: 298BE5D997EBAA02
2 changed files with 6 additions and 0 deletions

View file

@ -22,6 +22,8 @@
(when (modulep! +tree-sitter) (when (modulep! +tree-sitter)
(add-hook 'scala-mode-local-vars-hook #'tree-sitter! 'append)) (add-hook 'scala-mode-local-vars-hook #'tree-sitter! 'append))
(set-formatter! 'scalafmt '("scalafmt" "--stdin") :modes '(scala-mode))
(set-ligatures! 'scala-mode (set-ligatures! 'scala-mode
;; Functional ;; Functional
:def "def" :def "def"

View file

@ -11,3 +11,7 @@
(if (and (modulep! +lsp) (if (and (modulep! +lsp)
(not (executable-find "metals"))) (not (executable-find "metals")))
(warn! "metals isn't installed")) (warn! "metals isn't installed"))
(when (modulep! :editor format)
(unless (executable-find "scalafmt")
(warn! "Couldn't find scalafmt. Formatting will be disabled.")))