tree-sitter.allGrammars: exclude broken grammars (#472705)
This commit is contained in:
+6
-6
@@ -11,14 +11,14 @@ let
|
||||
path = "${drv}/parser";
|
||||
};
|
||||
|
||||
grammarPackage = grammars: pkgs.linkFarm "emacs-treesit-grammars" (map grammarToAttrSet grammars);
|
||||
|
||||
# Usage:
|
||||
# treesit-grammars.with-grammars (p: [ p.tree-sitter-bash p.tree-sitter-c ... ])
|
||||
with-grammars =
|
||||
fn:
|
||||
pkgs.linkFarm "emacs-treesit-grammars" (map grammarToAttrSet (fn pkgs.tree-sitter.builtGrammars));
|
||||
with-grammars = fn: grammarPackage (fn pkgs.tree-sitter.builtGrammars);
|
||||
|
||||
with-all-grammars = grammarPackage pkgs.tree-sitter.allGrammars;
|
||||
in
|
||||
{
|
||||
inherit with-grammars;
|
||||
|
||||
with-all-grammars = with-grammars (ps: lib.filter (p: !p.meta.broken) (lib.attrValues ps));
|
||||
inherit with-grammars with-all-grammars;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ let
|
||||
# pkgs.tree-sitter.withPlugins (p: [ p.tree-sitter-c p.tree-sitter-java ... ])
|
||||
#
|
||||
# or for all grammars:
|
||||
# pkgs.tree-sitter.withPlugins (_: allGrammars)
|
||||
# pkgs.tree-sitter.withPlugins (_: pkgs.tree-sitter.allGrammars)
|
||||
# which is equivalent to
|
||||
# pkgs.tree-sitter.withPlugins (p: builtins.attrValues p)
|
||||
withPlugins =
|
||||
@@ -98,7 +98,7 @@ let
|
||||
) grammars
|
||||
);
|
||||
|
||||
allGrammars = builtins.attrValues builtGrammars;
|
||||
allGrammars = lib.filter (p: !(p.meta.broken or false)) (lib.attrValues builtGrammars);
|
||||
|
||||
in
|
||||
rustPlatform.buildRustPackage (final: {
|
||||
|
||||
Reference in New Issue
Block a user