tree-sitter: replace hyphens with underscores in .withPlugins

nvim-treesitter expects underscores instead of hyphens, causing some
grammars not to be recognised
This commit is contained in:
LavaDesu 2021-09-01 17:54:42 +07:00
parent ed48b35991
commit 46232128d2
No known key found for this signature in database
GPG key ID: 6500251E087653C9

View file

@ -90,8 +90,9 @@ let
in
{
name =
(lib.strings.removePrefix "tree-sitter-"
(lib.strings.removeSuffix "-grammar" name))
(lib.strings.replaceStrings ["-"] ["_"]
(lib.strings.removePrefix "tree-sitter-"
(lib.strings.removeSuffix "-grammar" name)))
+ stdenv.hostPlatform.extensions.sharedLibrary;
path = "${drv}/parser";
}