-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add ability to auto-install language grammars #8
Conversation
Add autoloads for function to be available before require
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for getting this started! I think this will be great functionality to have. Now that we're on MELPA I want to make sure we stick to their guidelines as much as possible. I have three small warnings currently:
⛔ Warning (comp): treesit-auto.el:162:16: Warning: variable `_success' not left unused
⛔ Warning (comp): treesit-auto.el:161:16: Warning: variable `_grammar-missing' not left unused
⛔ Warning (comp): treesit-auto.el:183:20: Warning: defcustom for `treesit-auto-minor-mode' fails to specify containing group
I'll have a chance to look/test more thoroughly this afternoon
Cool, good to know that you're using Melpa standard to lint things. These should be addressed now. |
Co-authored-by: Robb Enzmann <32076780+renzmann@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the config I've used to test it:
(use-package treesit-auto
:load-path "~/repos/treesit-auto/"
:demand t
:config
(add-to-list 'treesit-auto-fallback-alist '(bash-ts-mode . sh-mode))
(advice-add 'treesit-install-language-grammar
:after (lambda (&rest _r) (treesit-auto-apply-remap)))
(setq treesit-auto-install 'prompt)
(global-treesit-auto-mode))
It's working great for me. Thanks for contributing!
Awesome! Thanks for merging this in. 💖 This package is now exactly what I feel the treesit system was missing. |
As a follow-up to #7, I've opened up this PR of my work so far for auto-installing grammars based on users' preferences.
To get this to work easily, I expanded
treesit-auto
to a global minor mode.This works pretty well for me, as is, but if you want this PR, I am happy to keep tweaking it as you feel necessary 🙂