renzmann / treesit-auto

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

Enable installation of well-known grammars based on matching file extensions #65

Closed renzmann closed 8 months ago

renzmann commented 8 months ago

Without this patch, opening up a hello.rs without rust-mode installed just leaves us in fundamental-mode without any of the expected benefits of treesit-auto.

This patch enables treesit-auto to install the grammar for a mode if the corresponding ts-mode is already installed, even if no fallback mode is installed. Some examples of ts-modes that come with Emacs 29 that don't have a fallback mode are:

  1. rust-ts-mode
  2. yaml-ts-mode
  3. toml-ts-mode
  4. go-ts-mode