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:
parent
26b8383cbd
commit
a70e634ebd
22 changed files with 81 additions and 96 deletions
|
@ -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!))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue