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

r-ts-mode recipe definition incorrect #59

Closed moberer closed 8 months ago

moberer commented 9 months ago

While looking through the definitions and the source code, I noticed a couple of likely problems with the definition of r-ts-mode:

First of all:

This leads me to the following recipe:

    ,(make-treesit-auto-recipe
      :lang 'r
      :ts-mode 'r-ts-mode
      :remap 'ess-r-mode
      :url "https://github.com/r-lib/tree-sitter-r"
      :ext "\\.(r|R)\\'")

Also: Thanks a lot for your otherwise really great package!

renzmann commented 9 months ago

Nice catch on the :remap and :ext values! We should probably include those changes. As you can tell, I'm not mainly an R guy, so I'll rely on folks like yourself to notice these things.

This package does not define tree-sitter modes, it just tells emacs to use them if they are installed. You'll need to either install an existing r-ts-mode or write one yourself. All I was able to find was this PoC, which looks like it hasn't seen a lot of love lately.

moberer commented 9 months ago

Thanks a lot for the clarification!

I edited the issue, such that only the part relevant to your package is left.

For some reason, I was of the assumption, that the *-ts-mode's were created by mapping some transformation over the base mode, but as it seems, it isn't actually that easy...

Thanks!

GongYiLiao commented 9 months ago

ESS actually has a tree-sitter branch with a draft r-ts-mode implementation.

see ESS's #1239 for more details