mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-05 18:20:29 -08:00
fix(tree-sitter): arity error installing grammars on <=29
This commit is contained in:
parent
fd643d78a8
commit
0d2f10dcab
1 changed files with 13 additions and 9 deletions
|
|
@ -99,15 +99,19 @@
|
|||
mode)))
|
||||
|
||||
:config
|
||||
;; HACK: Keep $EMACSDIR clean by installing grammars to the active profile.
|
||||
(add-to-list 'treesit-extra-load-path (file-name-concat doom-profile-data-dir "tree-sitter"))
|
||||
(defadvice! +tree-sitter--install-grammar-to-local-dir-a (fn lang &optional outdir &rest args)
|
||||
"Write grammars to `doom-profile-data-dir' instead."
|
||||
:around #'treesit-install-language-grammar
|
||||
:around #'treesit--build-grammar
|
||||
(apply fn lang
|
||||
(or outdir (file-name-concat doom-profile-data-dir "tree-sitter"))
|
||||
args))
|
||||
;; HACK: Keep $EMACSDIR clean by installing grammars to central location (the
|
||||
;; active profile).
|
||||
(let ((data-dir (file-name-concat doom-profile-data-dir "tree-sitter")))
|
||||
(add-to-list 'treesit-extra-load-path data-dir)
|
||||
;; Treesit's API saw major changes in 30.x.
|
||||
(if (< emacs-major-version 30)
|
||||
(defadvice! +tree-sitter--install-grammar-to-local-dir-a (fn out-dir &rest args)
|
||||
:around #'treesit--install-language-grammar-1
|
||||
(apply fn (or out-dir data-dir) args))
|
||||
(defadvice! +tree-sitter--install-grammar-to-local-dir-a (fn lang &optional out-dir &rest args)
|
||||
:around #'treesit-install-language-grammar
|
||||
:around #'treesit--build-grammar
|
||||
(apply fn lang (or out-dir data-dir) args))))
|
||||
|
||||
;; TODO: Move most of these out to modules
|
||||
(dolist (map '((awk "https://github.com/Beaglefoot/tree-sitter-awk" nil nil nil nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue