-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
helix: unable to fetch / build custom tree-sitter grammars #223732
Comments
It looks like |
This is a Helix issue rather than Nix or nixpkgs and it was covered by helix-editor/helix#3346. It's also relevant for other package managers since they usually install the runtime directory under It's been fixed on master: helix-editor/helix#5411 |
Thanks for the link! I'll check how a more recent version of helix will behave. |
Ah booh, it's a bit more complicated to test, as the tree-sitter grammars are not normally part of the repo, and only in the release tarballs 🤔 We could potentially nixify all that build as well, but it'll be a lot of work. Do you plan to do a new release soon, by any chance? ;-) |
If you have flakes enabled you can use the Helix flake to run the latest master: The next release is currently planned for 2023-03-31 |
I don't have flakes enabled, but I'll be happy to check the next release, if it's just around the corner. |
So Let's close this one. |
Describe the bug
tree-sitter
grammars are a bit of an odd beast. At runtime, they are very platform-specific.so
(or.dylib
) files, which is why the community seems to have settled on referring to source code of some javascript package, plus some c code, and compiling this every once in a while on the target machine running the editor.Helix compiles most of its grammars during build time, but also allows custom grammars to be configured. These configs point to checkouts of said node modules.
It ships some
hx --grammar fetch
andhx --grammar build
(sub)commands, which theoretically would (re)build existing grammars (shouldn't be necessary in our case for the ones shipped with helix itself), but also include new ones manually added to~/.config/helix/languages.toml
.This currently fails:
I'm not sure it's because we remove the grammars initially, or because the "upstream grammars" Helix itself is bundled with should be skipped (they can't change anyways, because their git rev is defined in the languages.toml of the source code we built helix with).
Maybe helix should only fetch/rebuild new ones in a local directory?
Another orthogonal thing would be to be able to point helix to a
.so
/.dylib
file directly (even though it's platform-specific), rather than this compiling at runtime - but that'd be a feature request for helix, and I'm not sure it's a good idea.Steps To Reproduce
Steps to reproduce the behavior:
~/.config/helix/languages.toml
, as described in https://docs.helix-editor.com/guides/adding_languages.html#adding-languageshx --grammar fetch
Expected behavior
I'd expect helix to fetch (and later compile) the added grammar.
Notify maintainers
@danth @yusdacra
Also cc @the-mikedavis
The text was updated successfully, but these errors were encountered: