mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-04 15:03:42 -05:00
feat(sml): add treesit (and lsp) support
This commit is contained in:
@@ -3,11 +3,14 @@
|
||||
(use-package! sml-mode
|
||||
:mode "\\.s\\(?:ml\\|ig\\)\\'"
|
||||
:config
|
||||
(set-repl-handler! 'sml-mode #'run-sml)
|
||||
(set-formatter! 'smlformat '("smlformat") :modes '(sml-mode))
|
||||
(set-repl-handler! '(sml-mode sml-ts-mode) #'run-sml)
|
||||
(set-formatter! 'smlformat '("smlformat") :modes '(sml-mode sml-ts-mode))
|
||||
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'sml-mode-local-vars-hook #'lsp! 'append))
|
||||
|
||||
;; don't auto-close apostrophes (type 'a = foo) and backticks (`Foo)
|
||||
(sp-with-modes 'sml-mode
|
||||
(sp-with-modes '(sml-mode sml-ts-mode)
|
||||
(sp-local-pair "'" nil :actions nil)
|
||||
(sp-local-pair "`" nil :actions nil))
|
||||
|
||||
@@ -23,6 +26,19 @@
|
||||
:desc "Run region" "r" #'sml-prog-proc-send-region))
|
||||
|
||||
|
||||
;; TODO: Mirror sml-mode keybinds to ts-mode
|
||||
(use-package! sml-ts-mode
|
||||
:when (modulep! +tree-sitter)
|
||||
:when (fboundp 'treesit-available-p)
|
||||
:defer t
|
||||
:init
|
||||
(set-tree-sitter! 'sml-mode 'sml-ts-mode
|
||||
'((sml :url "https://github.com/MatthewFluet/tree-sitter-sml")))
|
||||
:config
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'sml-ts-mode-local-vars-hook #'lsp! 'append)))
|
||||
|
||||
|
||||
(use-package! company-mlton
|
||||
:when (modulep! :completion company)
|
||||
:hook (sml-mode . company-mlton-init)
|
||||
|
Reference in New Issue
Block a user