renzmann / treesit-auto

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

Here is a swift tree-sitter that works great. #15

Closed konrad1977 closed 1 year ago

konrad1977 commented 1 year ago

This is the one I use I think it performs great for swift. https://gitlab.com/woolsweater/tree-sitter-swifter

Would be nice if it could be added? (or if I can add it my-self somehow).

renzmann commented 1 year ago

Happy to include it!

if I can add it my-self somehow

In case there are any questions around this, a simple fork + pull request works if the contributor tag is important to you. Otherwise I'll go ahead and just add it in here: https://github.com/renzmann/treesit-auto/blob/40ccc0dc97a3b13f4497a310264a9723baef920e/treesit-auto.el#L99-L105

konrad1977 commented 1 year ago

You can just go a head and add it. The tag is not important =)

renzmann commented 1 year ago

The link in the original post doesn't include a parser.c, so it's not compatible with the Emacs treesit library. If there's another version of the grammar out there with this file, though, I'll include it

konrad1977 commented 1 year ago

This ones also works. Its a bit slow though. https://github.com/alex-pinkus/tree-sitter-swift

konrad1977 commented 1 year ago

A bit off topic. But when using the built in treesit (29.x) where do you put your grammars/highlight file?

renzmann commented 1 year ago

This ones also works. Its a bit slow though. https://github.com/alex-pinkus/tree-sitter-swift

I took a look there too, but don't see a parser.c there either, so it still won't work with Emacs' treesit-install-langauge-grammar.

...when using the built in treesit (29.x) where do you put your grammars/highlight file?

By default, Emacs uses ~/.emacs.d/tree-sitter as the install location for the libraries. However, any location on treesit-extra-load-path will work. See the "Parsing Program Source" section in the "elisp" manual for all the goodies: C-h R elisp RET m Parsing Program Source RET