Skip to content

tree-sitter: restore extraGrammars#536475

Closed
khaneliman wants to merge 1 commit into
NixOS:masterfrom
khaneliman:tree-sitter-extra-grammars-extension
Closed

tree-sitter: restore extraGrammars#536475
khaneliman wants to merge 1 commit into
NixOS:masterfrom
khaneliman:tree-sitter-extra-grammars-extension

Conversation

@khaneliman

Copy link
Copy Markdown
Contributor

The grammar source refactor removed the hook overlays used to add grammars before builtGrammars is computed. Add it back so custom grammar sources populate tree-sitter.grammars, tree-sitter.builtGrammars, tree-sitter-grammars, and withPlugins from one override.

Follow up to #408414 to restore the extraGrammars arg that makes it easy to extend the set.

Things done

The grammar source refactor removed the hook overlays used to add grammars before builtGrammars is computed. Add it back so custom grammar sources populate tree-sitter.grammars, tree-sitter.builtGrammars, tree-sitter-grammars, and withPlugins from one override.
@nixpkgs-ci nixpkgs-ci Bot requested review from amaanq and uncenter June 28, 2026 22:51
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 6.topic: tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. labels Jun 28, 2026

@RossSmyth RossSmyth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say that one should almost always prefer overrideScope wrt modifying package set, but it seems the tree-sitter pkgset does not use that, and uses an ad-hoc extension API.

Looks good.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 29, 2026
@khaneliman khaneliman deleted the tree-sitter-extra-grammars-extension branch July 5, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 6.topic: tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants