mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-27 14:23:43 -05:00
feat(erlang): add treesit support
This commit is contained in:
@@ -5,9 +5,16 @@
|
||||
:mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
|
||||
:mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode)
|
||||
:config
|
||||
(set-formatter! 'erlfmt '("rebar3" "fmt" "-") :modes '(erlang-mode))
|
||||
(set-formatter! 'erlfmt '("rebar3" "fmt" "-")
|
||||
:modes '(erlang-mode erlang-ts-mode))
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'erlang-mode-local-vars-hook #'lsp! 'append))
|
||||
(add-hook 'erlang-mode-local-vars-hook #'lsp! 'append)))
|
||||
|
||||
(when (modulep! +tree-sitter)
|
||||
(add-hook 'erlang-mode-local-vars-hook #'tree-sitter! 'append)))
|
||||
|
||||
(use-package! erlang-ts
|
||||
:when (modulep! +tree-sitter)
|
||||
:when (fboundp 'erlang-ts-mode)
|
||||
:defer t
|
||||
:init
|
||||
(set-tree-sitter! 'erlang-mode 'erlang-ts-mode
|
||||
'((erlang "https://github.com/WhatsApp/tree-sitter-erlang"))))
|
||||
|
@@ -5,6 +5,10 @@
|
||||
(modulep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (modulep! +tree-sitter))
|
||||
(modulep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(when (modulep! :editor format)
|
||||
(unless (and (executable-find "rebar3") (zerop (car (doom-call-process "rebar3" "fmt" "-v"))))
|
||||
(warn! "Couldn't find erlfmt. Formatting will be disabled.")))
|
||||
|
@@ -2,3 +2,6 @@
|
||||
;;; lang/erlang/packages.el
|
||||
|
||||
(package! erlang :pin "b9d3ec017da091168918a2901a1cef4cb062fd2a")
|
||||
|
||||
(when (modulep! +tree-sitter)
|
||||
(package! erlang-ts :pin "eb579dd55fbb2cf721290939e7b3a50be19c0305"))
|
||||
|
Reference in New Issue
Block a user