-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: support configuring grammars #2871
Comments
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Anything new ? |
there are many treesitter grammars available in nixpkgs, can one give a folder to helix as source ? (btw neovim user here so be the change you want to see :p ) |
I use neovim as well and was going to try out Helix, but then didn’t when I realised you couldn’t configure grammars via Nix, which is why I opened this issue. I might get around to implementing this when I have more time, but I’m happy with neovim for now so I’m not really interested in this issue anymore. |
Well I am interested in it since otherwise I would have to use neovim too for unsupported languages. |
I think this commit should already support this: Philipp-M@8bdd7cc |
Your commit works as expected and allows to add grammar configuration. However there is another issue which is that Helix cannot build the parsers where it tries to. ~/.config/nixpkgs main* ⇡ ❯ hx --grammar fetch
Fetching 115 grammars
115 grammars failed to fetch
Failure 1/115: Could not create grammar directory "/nix/store/nf77kkk8bglvznsbkni8m1v3k2gng37x-helix-runtime/grammars/sources/rust"
Failure 2/115: Could not create grammar directory "/nix/store/nf77kkk8bglvznsbkni8m1v3k2gng37x-helix-runtime/grammars/sources/toml" |
Yeah I expected something like that. Helix tries to compile the libraries to the You could create an overlay with a different Or probably best: Create a PR in the helix repo that allows loading of precompiled dynamic libs directly. Starting points are here and here But if you don't want to deep-dive into the source code, you could also just create a PR extending the default languages.toml in the helix repo and use the flake in the repo, this is probably the simplest solution for this problem (I did this for a language once, these kinds of PRs get merged rather quickly). |
Problem being I have no clue how to do any of that. The language I'm trying to add is too niche to make a PR to helix and I don't know enough nix to create the overlay properly. |
Well the language I was talking about likely has just one user (me ^^) here: helix-editor/helix#3048 Creating a PR doesn't hurt I guess, and even if it doesn't get merged (which I don't believe, if done properly), you could maintain your own fork worst-case. |
sure ! I'll consider it, shouldn't be any hard at all. "Fixing" the issue on nix's side might be useful for other people/times though. |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Support configuring tree-sitter grammars in
languages.toml
for Helix.The
use-grammars
key should also be supported, which controls which grammars are fetched and built (if omitted all grammars are used).The text was updated successfully, but these errors were encountered: