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

The new version opens the CPP file and cannot find C (the right that should be found C ++) #92

Open ipyffor opened 4 months ago

ipyffor commented 4 months ago

Steps to Reproduce:

  1. Open cpp file, install cpp treesit
  2. restart emacs
  3. Open cpp file, tip: Warning (treesit): Cannot activate tree-sitter, because language grammar for c is unavailable

    Temporarily can be solved by installing the Treesit library of C:

    Open c file to install c treesit lib

renzmann commented 3 months ago

In our recipe for C++, we don't have a :requires keyword in there:

https://github.com/renzmann/treesit-auto/blob/1b63bc5e50def3c14ab69e53ed6e7f65a7482016/treesit-auto.el#L130-L135

For instance, we say that gomod requires go

https://github.com/renzmann/treesit-auto/blob/1b63bc5e50def3c14ab69e53ed6e7f65a7482016/treesit-auto.el#L173-L179

If you open a PR that adds this :requries keyword and test that it works for your use case, I'm happy to take it