tree-sitter update script: Gitlab support#199566
Closed
Profpatsch wants to merge 8 commits intoNixOS:masterfrom
Closed
tree-sitter update script: Gitlab support#199566Profpatsch wants to merge 8 commits intoNixOS:masterfrom
Profpatsch wants to merge 8 commits intoNixOS:masterfrom
Conversation
The allGrammars had to be patched at both use-sites, so let’s pull that into the original definition. Adds a few more docstrings.
`repo` and `orga` are not required to print the `default.nix`. This will be relevant because `gitlab` is going to be added, which does not have these two fields.
We want to be able to download tree-sitter grammars from other platforms. The first, easiest target is gitlab. Gitlab uses a `projectId` instead of orga/repo though, so we need to implement it differently (also checking the latest version of a repo works differently).
This uses the gitlab API to download the jsonc grammar. Currently the gitlab support only allows for gitlab.com, but that could be changed quite easily. I opted for copying a lot of the github code, since it’s too early to factor out shared code.
13 tasks
Member
|
Gitlab is supported for grammar sources, at least as of #408414. The other part of this one is adding https://gitlab.com/WhyNotHugo/tree-sitter-jsonc, which hasn't actually been updated since late 2021 — don't know if we still need to add it? |
Member
|
Looks like the tree-sitter-json grammar (including the version we have it pinned to) supports comments now and has for a bit. Ref: nvim-treesitter/nvim-treesitter#8316, https://github.com/tree-sitter/tree-sitter-json/blob/001c28d7a29832b06b0e831ec77845553c89b56d/grammar.js#L94-L100, tree-sitter/tree-sitter-json@124edff Closing as the JSONC part is also no longer necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Builds on #199547.
Implement support for gitlab.com & add the jsonc grammar.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes