renzmann / treesit-auto

Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
GNU General Public License v3.0
377 stars 29 forks source link

Prompt to install grammar if they're defined in `treesit-language-source-alist` #7

Closed justinbarclay closed 1 year ago

justinbarclay commented 1 year ago

I think it would help with the overall tree-sitter experience if some package tried to install the grammar for a particular ts-mode if it is detected missing. Then if that installation doesn't work or is declined, we fall back to the major mode.

I wonder if this is the package for that or if you would consider it scope creep. But I know you are maintaining a mapping of language to grammar, so I thought I'd suggest it here.

If you're interested in adding that capability to your package, I'm happy to work on it with you. In fact, I've started working on an implementation for my use here.

renzmann commented 1 year ago

This is something that crossed my mind, and I'm open to including some functionality like it. Though I'd prefer to keep the default behavior of "do nothing and don't ask", with a configurable setting that enables one of two behaviors:

  1. nil: Don't prompt or attempt install (default)
  2. t: Always attempt install in the background - message on success, warning on failure
  3. 'ask: Display a pop up

I know having this would certainly help my workflow/setup, so I imagine it would be nice for others too

justinbarclay commented 1 year ago

I'm closing this after #8 was merged 🎉