Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treesit-auto-install-all keeps asking about recipes. #38

Closed
abougouffa opened this issue Mar 18, 2023 · 0 comments · Fixed by #39
Closed

treesit-auto-install-all keeps asking about recipes. #38

abougouffa opened this issue Mar 18, 2023 · 0 comments · Fixed by #39

Comments

@abougouffa
Copy link
Contributor

abougouffa commented Mar 18, 2023

Hello,

I'm using treesit-auto as follows:

(use-package treesit-auto
  :straight (:host github :repo "renzmann/treesit-auto")
  :after treesit
  :demand t
  :custom
  (treesit-auto-install 'prompt)
  :config
  (setq ;; Auto install all supported languages
   treesit-auto-langs
   (cl-loop for recipe in treesit-auto-recipe-list
            collect (treesit-auto-recipe-lang recipe)))
 (global-treesit-auto-mode 1))

I like to install all the grammars ahead of time, so I call treesit-auto-install-all. However, when invoking it, it keeps saying:

Screenshot_20230318_173552

The problem comes from treesit-language-source-alist, which is set to nil globally and only modified locally in treesit-auto--on. This hack fixes the issue:

(setq treesit-language-source-alist (treesit-auto--build-treesit-source-alist))

;; OR THIS ONE

(advice-add
 'treesit-auto-install-all :before
 (lambda ()
   (setq-local treesit-language-source-alist
               (treesit-auto--build-treesit-source-alist))))
abougouffa added a commit to abougouffa/treesit-auto that referenced this issue Mar 18, 2023
abougouffa added a commit to abougouffa/treesit-auto that referenced this issue Mar 18, 2023
@renzmann renzmann linked a pull request Mar 19, 2023 that will close this issue
renzmann added a commit that referenced this issue Mar 19, 2023
Fix `treesit-auto-install-all` (#38)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant