treesit-auto
treesit-auto copied to clipboard
treesit-auto-install-all command failed
The error msg:
The following tree-sitter grammars are/were missing:
janet
latex
markdown
+1 Same issue here
This has not been fixed yet.
This has not been fixed yet.
I'm not sure if this is still being maintained TBH. Does anyone know if there's a popular fork of this?
(setq treesit-language-source-alist
'((bash "https://github.com/tree-sitter/tree-sitter-bash" nil "src")
(c "https://github.com/tree-sitter/tree-sitter-c" nil "src")
(cpp "https://github.com/tree-sitter/tree-sitter-cpp" nil "src")
(css "https://github.com/tree-sitter/tree-sitter-css" nil "src")
(go "https://github.com/tree-sitter/tree-sitter-go" nil "src")
(html "https://github.com/tree-sitter/tree-sitter-html" nil "src")
(java "https://github.com/tree-sitter/tree-sitter-java" nil "src")
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
(json "https://github.com/tree-sitter/tree-sitter-json" nil "src")
(python "https://github.com/tree-sitter/tree-sitter-python" nil "src")
(rust "https://github.com/tree-sitter/tree-sitter-rust" nil "src")
(toml "https://github.com/tree-sitter/tree-sitter-toml" nil "src")
(yaml "https://github.com/ikatyang/tree-sitter-yaml" nil "src")
))
(defun solarion/treesit-ensure (&rest langs)
"install missing treesit grammar"
(dolist (lang langs)
(unless (treesit-language-available-p lang)
(treesit-install-language-grammar lang))))
;; run at first installation
;; (solarion/treesit-ensure 'bash 'c 'cpp 'css 'go 'html 'java
;; 'javascript 'typescript 'tsx 'json
;; 'python 'rust 'toml 'yaml)
(setq major-mode-remap-alist
'((c-mode . c-ts-mode)
(c++-mode . c++-ts-mode)
(c-or-c++-mode . c-or-c++-ts-mode)
(conf-toml-mode . toml-ts-mode)
(css-mode . css-ts-mode)
(js-mode . js-ts-mode)
(javascript-mode . js-ts-mode)
(js-json-mode . json-ts-mode)
(json-mode . json-ts-mode)
(python-mode . python-ts-mode)
(sh-mode . bash-ts-mode)
(typescript-mode . typescript-ts-mode)
(yaml-mode . yaml-ts-mode)
))
Here is my workaround, FYI