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
Tree sitter fetch all grammars #107514
Tree sitter fetch all grammars #107514
Conversation
I am not sure yet but it would be nice to keep the lua grammar ( https://github.com/nvim-treesitter/tree-sitter-lua ): neovim may require it for its 0.5 release. |
I am unsure how the lua grammar was added, since the update script would definitely not keep it. We are going to have to add a list of extra grammars to the updater. |
As in, it would want a dependency? |
It may become a dependency, it has not been decided yet. Even without I would like to keep it. Maybe it can be defined somewhere else to make it clear it's not automatically updated. |
it should definitely be automatically updated |
It’s easy to add, let me take a look. |
Result of 1 package built:
|
Result of 1 package built:
|
The update script would only fetch the few grammars listed in the tree-sitter repository previously. But the tree-sitter github orga has a rather large amount of officially supported grammars. Thus we change the script to query the github APIs for repositories instead (up to 100 this is supported without paging). Since the repository list also contains some that are not grammars, there is a bash script which lists all repos we are aware of and the ones we want to ignore. It will make sure we don’t forget any repositories in the future, by comparing to the actual list with jq.
The new update scripts gives us a bunch of new grammars!
We want the ability to add different orga repos as well, and that is a lot easier on the nix level.
Some of the grammars are not in the official orga, like tree-sitter-lua, so we make sure the updater knows how to fetch them.
2f5d528
to
0181e10
Compare
@teto I refactored a little, now we can add more repositories that are not from the tree-sitter orga. |
4c179e9
to
00359f2
Compare
The configuration is scattered through several whiltelists/orgs, my approach would have been to put a single list with the different attributes (organisation, ignore etc) but as long as it works, it's fine. Feel free to merge when ready. |
We want the tree-sitter org grammars to be complete always, this is why they are handled specially, because the update script checks whether we missed a repo. |
The update script would only fetch the few grammars listed in the
tree-sitter repository previously. But the tree-sitter github orga has
a rather large amount of officially supported grammars.
Thus we change the script to query the github APIs for repositories
instead (up to 100 this is supported without paging).
Since the repository list also contains some that are not grammars,
there is a bash script which lists all repos we are aware of and the
ones we want to ignore. It will make sure we don’t forget any
repositories in the future, by comparing to the actual list with jq.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)