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

Consider update from old Lua grammar #9726

Closed
briandorsey opened this issue Feb 25, 2024 · 3 comments · Fixed by #9727
Closed

Consider update from old Lua grammar #9726

briandorsey opened this issue Feb 25, 2024 · 3 comments · Fixed by #9727

Comments

@briandorsey
Copy link
Contributor

briandorsey commented Feb 25, 2024

Helix appears to be referencing a two year old version of the Lua grammar:
https://github.com/helix-editor/helix/blob/928bf80d9a1d6206f864e9b375f67662a49a6265/languages.toml#L1104C75-L1104C115

[[grammar]]
name = "lua"
source = { git = "https://github.com/MunifTanjim/tree-sitter-lua", rev = "887dfd4e83c469300c279314ff1619b1d0b85b91" }

There is a more recent release (and new repo url, which appears to be the same repo, just moved):
tree-sitter-grammars/tree-sitter-lua@88e4464

Is it possible/easy to update this? Is it just a matter of changing the values? eg, something like this:

[[grammar]]
name = "lua"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-lua", rev = "88e446476a1e97a8724dff7a23e2d709855077f2" }
@briandorsey
Copy link
Contributor Author

Follow up. I tested locally by adding a .config/helix/languages.toml file with the following content:

use-grammars = { only = [ "lua" ] }

[[grammar]]
name = "lua"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-lua", rev = "88e446476a1e97a8724dff7a23e2d709855077f2" }

Then updated the grammar:

% hx --grammar fetch
Fetching 1 grammars
1 updated grammars
	lua now on 88e446476a1e97a8724dff7a23e2d709855077f2
% hx --grammar build
Building 1 grammars
1 grammars built now
	["lua"]

Then confirmed that the new grammar is being used. It is, yea!

This is also a work-around for anyone who needs updated Lua parsing before helix itself is updated.

@archseer
Copy link
Member

Can you open a PR?

@briandorsey
Copy link
Contributor Author

Just created a PR. Please take a look when it's convenient.

@briandorsey briandorsey changed the title Consider update from old LUA grammar Consider update from old Lua grammar Feb 26, 2024
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 a pull request may close this issue.

2 participants