Browse Source

nixpkgs/neovim: copy queries from out-of-tree treesitter plugins

Thomas Dy 3 weeks ago
parent
commit
64dfa3c9f6
1 changed files with 6 additions and 0 deletions
  1. 6 0
      .config/nixpkgs/neovim/treesitter/default.nix

+ 6 - 0
.config/nixpkgs/neovim/treesitter/default.nix

@@ -27,6 +27,12 @@ let
     } ''
       mkdir -p $out/parser
       ln -s ${grammar}/parser $out/parser/${name}.so
+
+      ${lib.optionalString (builtins.hasAttr "branch" spec) ''
+        if [ -d ${grammar}/queries ]; then
+          ln -s ${grammar}/queries $out/queries
+        fi
+      ''}
     '';
 in
 builtins.mapAttrs buildTreesitterPlugin grammars