Skip to content
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

Swift tree-sitter grammar is out of date #3452

Closed
alex-pinkus opened this issue Aug 16, 2022 · 1 comment · Fixed by #3461
Closed

Swift tree-sitter grammar is out of date #3452

alex-pinkus opened this issue Aug 16, 2022 · 1 comment · Fixed by #3461
Labels
A-tree-sitter Area: Tree-sitter C-enhancement Category: Improvements

Comments

@alex-pinkus
Copy link

A while back, we discussed an approach that would allow Helix to consume the Swift grammar directly from my repository rather than the fork it currently uses. The end result (which has worked pretty well in my repo) is that my with-generated-files branch gets updates every time a new release is published, which allows (for instance) the CodeEditTextView to consume that branch using the prebuilt grammar from SwiftPM.

I notice that you haven't yet switched! I don't have a problem with that, but you should know that since then there have been quite a few very useful improvements, such as:

  • Significantly improving query load time by simplifying pattern match logic
  • Fixing some parsing bugs with binary expressions and function calls
  • Supporting edge cases that source code editors often care about, like files that end in a comment or without a newline.

Switching should now be as easy as just using rev 77c6312c8438f4dbaa0350cec92b3d6dd3d74a66 , the latest commit on with-generated-files. I would offer to do it myself but I haven't ramped up on building Helix so I wouldn't be able to do a sanity check after trying it out.

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements A-tree-sitter Area: Tree-sitter labels Aug 17, 2022
@the-mikedavis
Copy link
Member

Sweet! I see the new revision being at least twice as fast as what we have pinned for query analysis in debug builds 🚀

Switching to the new branch must've fell through the cracks, I could've sworn there was a PR 😅

I'll make one now and update the queries as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants