Merge pull request #230751 from DamienCassou/emacs-tree-sitter-grammars
This commit is contained in:
commit
2a26bcd60c
|
@ -73,6 +73,8 @@ in
|
|||
|
||||
tree-sitter-langs = callPackage ./manual-packages/tree-sitter-langs { final = self; };
|
||||
|
||||
treesit-grammars = callPackage ./manual-packages/treesit-grammars { };
|
||||
|
||||
tsc = callPackage ./manual-packages/tsc { };
|
||||
|
||||
urweb-mode = callPackage ./manual-packages/urweb-mode { };
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{ pkgs, lib, tree-sitter, ... }:
|
||||
|
||||
let
|
||||
libExt = pkgs.stdenv.targetPlatform.extensions.sharedLibrary;
|
||||
grammarToAttrSet = drv:
|
||||
{
|
||||
name = "lib/lib${lib.strings.removeSuffix "-grammar" (lib.strings.getName drv)}${libExt}";
|
||||
path = "${drv}/parser";
|
||||
};
|
||||
in
|
||||
{
|
||||
with-all-grammars = pkgs.linkFarm "emacs-treesit-grammars"
|
||||
(map grammarToAttrSet pkgs.tree-sitter.allGrammars);
|
||||
|
||||
# Use this one like this:
|
||||
# treesit-grammars.with-grammars (grammars: with grammars; [tree-sitter-bash])
|
||||
with-grammars = fn: pkgs.linkFarm "emacs-treesit-grammars"
|
||||
(map grammarToAttrSet (fn pkgs.tree-sitter.builtGrammars));
|
||||
}
|
Loading…
Reference in a new issue