Skip to content

tree-sitter update script: Gitlab support#199566

Closed
Profpatsch wants to merge 8 commits intoNixOS:masterfrom
Profpatsch:tree-sitter-update-gitlab-support
Closed

tree-sitter update script: Gitlab support#199566
Profpatsch wants to merge 8 commits intoNixOS:masterfrom
Profpatsch:tree-sitter-update-gitlab-support

Conversation

@Profpatsch
Copy link
Member

Description of changes

Builds on #199547.

Implement support for gitlab.com & add the jsonc grammar.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

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.
@Profpatsch Profpatsch requested a review from jonringer as a code owner November 4, 2022 21:00
@github-actions github-actions bot added the 6.topic: vim Advanced text editor label Nov 4, 2022
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 4, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 21, 2023
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@uncenter
Copy link
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?

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 17, 2025
@uncenter uncenter added the 6.topic: tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. label Dec 17, 2025
@uncenter
Copy link
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.

@uncenter uncenter closed this Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. 6.topic: vim Advanced text editor 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants