File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
pkgs/applications/editors/vim/plugins/nvim-treesitter Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 5757 # pkgs.vimPlugins.nvim-treesitter.withAllGrammars
5858 withPlugins =
5959 f :
60+ let
61+ selectedGrammars = f ( tree-sitter . builtGrammars // builtGrammars ) ;
62+ grammarNames = map ( g : lib . removeSuffix "-grammar" ( lib . getName g ) ) selectedGrammars ;
63+ in
6064 self . nvim-treesitter . overrideAttrs {
61- passthru . dependencies = map grammarToPlugin ( f ( tree-sitter . builtGrammars // builtGrammars ) ) ;
65+ passthru . dependencies = map grammarToPlugin selectedGrammars ;
66+
67+ postPatch = ''
68+ mkdir queries
69+
70+ if [[ -d "runtime/queries" ]]; then
71+ for lang in ${ lib . escapeShellArgs grammarNames } ; do
72+ if [[ -d "runtime/queries/$lang" ]]; then
73+ mv "runtime/queries/$lang" "queries/$lang"
74+ fi
75+ done
76+
77+ rmdir runtime/queries 2>/dev/null || true
78+ rmdir runtime 2>/dev/null || true
79+ fi
80+ '' ;
6281 } ;
6382
6483 withAllGrammars = withPlugins ( _ : allGrammars ) ;
You can’t perform that action at this time.
0 commit comments