-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Swift language. Current is not the most active one. #72
Comments
Yeah. Can you try it out and open a pull request? |
Yeah that worked. Used the highlight.scm also. Now I can adjust highlightning. I am no ninja at git so I actually did a copy of the repo on disk and then run script/compile swift. https://github.com/alex-pinkus/tree-sitter-swift this seems to be alot more mature than the previous one. Maybe update? Its a bit slow. It takes some seconds to load a swift file. Can it be optimized with a compiler flag maybe? It's seems to be a debug version. |
FYI, query load time (especially for swift) is greatly improved if the grammar is generated using |
Hi @alex-pinkus I think we cannot use anything above 19.5 for now, for comparbility reasons. |
I noticed that most of them can change :background but not :foreground. Any ideas why @ubolonton ? (in emacs when I setup my own theme. |
This sounds like an issue with your (theme) setup. In any case, you would have better luck with one of these:
|
I also have a Swift grammar that I have been developing and using with emacs-tree-sitter for the past year: https://gitlab.com/woolsweater/tree-sitter-swifter . I was unaware of this other effort until now; I came here to mention mine and saw this issue instead. 😅 |
@woolsweater How do I try out your grammar? How much difference does it do, I never got it work with Emacs and Swift and I am curious if it's worth the effort. |
@konrad1977 I believe the best way to try any alternative grammar is to follow the tree-sitter-langs instructions for Building Grammars From Source. You would just change the appropriate language submodule to point to the alternative repo. From there how you load it into Emacs depends on your choice of package manager. If you happen to use straight.el, I can point you to how I do it in my .emacs.d. I'm afraid I am not familiar enough with other managers to offer advice there. |
@woolsweater do you notice any slow downs? Could you share a screen shot with and without tree-sitter enabled? (Is it worth it)? |
@konrad1977 Good idea! I have added a README and some screenshots to my repo. I find the performance of elisp-tree-si/tter and my grammar to be a non-issue in daily use. It was already fine in Emacs 27 and pretty much everything seems snappier with 28 🙂 Using elisp-tree-sitter is definitely worth it, not just for Swift but for any supported language. |
@ubolonton elisp-tree-sitter does not support multiple grammars for a programming language, does it? I am unsure how best to handle this situation where there are two options. (I doubt that our grammars are mergeable or that it would even make sense to try to merge them.) |
@woolsweater I compiled it my self and got it working yesterday. Works great (almost all the time). Didn't notice any speed bumps but I'm currently on a M1 Max MBP. |
@ubolonton maybe its a good idea to change the language to @woolsweater version? The old one havent been updated in 3 years (and doesn't include any rules so its more or less useless). I havent tried @alex-pinkus version but it would be nice to try that one to. @woolsweater maybe you have compared your version with @alex-pinkus? |
Looks like this repo is the one that is undergoing active development, maybe switch to this one?
https://github.com/alex-pinkus/tree-sitter-swift
The text was updated successfully, but these errors were encountered: