treesit-auto
treesit-auto copied to clipboard
delete latex, fix janet-simple, and fix markdown, add elisp and solidity language
releated to #116
FWIW, I managed to install latex grammar using the following snippet:
(defun pk/treesit-generate-parser (&rest args)
"Try to run \\='tree-sitter generate\\=' if there's no parser.c."
(when-let* (((equal "parser.c" (car (last args))))
((not (file-exists-p (expand-file-name "parser.c"))))
(tree-sitter (executable-find "tree-sitter"))
(default-directory (file-name-parent-directory default-directory)))
(message "Generating parser.c")
(treesit--call-process-signal
tree-sitter nil t nil "generate")))
(advice-add 'treesit--call-process-signal
:before #'pk/treesit-generate-parser)
Putting it just for posterity here, but perhaps something similar (as in: generate parser.c if not found in the repo) should find its way to Emacs. However it certainly won't be available before Emacs 30.2, so anyone on Emacs 29 and perhaps some time in the future can find a use of it.