Skip to content

Update grammar for Tree-sitter ABI 14 compatibility #2

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BernardIgiri
Copy link

🔁 Replaces #1

This updates the grammar to work with Tree-sitter ABI 14, which is required by Helix Editor 25 and other modern tooling.


Why

I was trying to use this grammar in Helix, but encountered this error:

QueryError { message: "Incompatible language version 8. Expected minimum 13, maximum 14", kind: Language }

What Changed

To resolve this, I:

  • Re-initialized the grammar with tree-sitter init
  • Regenerated the parser with tree-sitter generate --abi=14
  • Split auto-generated files and manual grammar/test logic into separate commits to improve clarity and reviewability (per feedback on Update grammar for Tree-sitter ABI 14 compatibility #1)

How I Verified

I added the grammar to Helix with the following config:

# languages.toml
[[grammar]]
name = "fluent"
source = { git = "https://github.com/BernardIgiri/tree-sitter-fluent.git", rev = "master" }

[[language]]
name = "fluent"
scope = "source.fluent"
file-types = ["ftl"]
comment-token = "#"

And used this highlights query file:

; Comments
(block_comment) @comment
(comment) @comment
(resource_comment) @comment

; Messages and terms
(message) @function
(term) @constant

; Identifiers
(identifier) @variable
(term_identifier) @constant

; Patterns (string content)
(pattern) @string

With this, Fluent .ftl files now display correctly in Helix 25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant