mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -67,6 +67,11 @@ This is ignored by ccls.")
|
||||
:return "return"
|
||||
:yield "#require")
|
||||
|
||||
(when (featurep! +tree-sitter)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook)
|
||||
:append #'tree-sitter!))
|
||||
|
||||
;; HACK Suppress 'Args out of range' error in when multiple modifications are
|
||||
;; performed at once in a `c++-mode' buffer, e.g. with `iedit' or
|
||||
;; multiple cursors.
|
||||
@ -304,9 +309,3 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
|
||||
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
||||
"-isystem/usr/local/include"]
|
||||
:resourceDir (cdr (doom-call-process "clang" "-print-resource-dir"))))))))
|
||||
|
||||
;; Tree sitter
|
||||
(eval-when! (featurep! +tree-sitter)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook)
|
||||
#'tree-sitter!))
|
||||
|
Reference in New Issue
Block a user