refactor(:lang): move tree-sitter init

Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
This commit is contained in:
Henrik Lissner 2022-07-25 17:34:44 +02:00
parent 26b8383cbd
commit a70e634ebd
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
22 changed files with 81 additions and 96 deletions

View file

@ -166,6 +166,13 @@
;;
;;; Tools
(when (featurep! +tree-sitter)
(add-hook! '(js2-mode-local-vars-hook
typescript-mode-local-vars-hook
typescript-tsx-mode-local-vars-hook
rjsx-mode-local-vars-hook)
:append #'tree-sitter!))
(add-hook! '(typescript-mode-local-vars-hook
typescript-tsx-mode-local-vars-hook
web-mode-local-vars-hook
@ -320,12 +327,3 @@ to tide."
(def-project-mode! +javascript-gulp-mode
:when (locate-dominating-file default-directory "gulpfile.js"))
;; Tree sitter
(eval-when! (featurep! +tree-sitter)
(add-hook! '(js-mode-local-vars-hook
js2-mode-local-vars-hook
typescript-mode-local-vars-hook
typescript-tsx-mode-local-vars-hook
rjsx-mode-local-vars-hook)
#'tree-sitter!))