[分享] 自定义 ` tree-sitter language grammar library` 安装路径。

 (defvar treesit:load-path (no-littering-expand-var-file-name "tree-sitter"))
 (add-to-list 'treesit-extra-load-path treesit:load-path)
  (defun treesit:patch--path (fn &rest arg)
    (unless (nth 0 arg)
      (setf (car arg) treesit:load-path))
    (apply fn arg))
  (advice-add #'treesit--install-language-grammar-1 :around #'treesit:patch--path)

可以自定义 treesit:load-path 来安装和加载 tree-sitter 库文件。

1 个赞