|
|
@@ -2,6 +2,24 @@
|
|
|
let
|
|
|
grammars = builtins.fromJSON (builtins.readFile ./grammars.json);
|
|
|
|
|
|
+ overrides = {
|
|
|
+ "svelte" = let
|
|
|
+ nvimSvelteSrc = fetchFromGitHub {
|
|
|
+ owner = "themixednuts";
|
|
|
+ repo = "nvim-treesitter-svelte";
|
|
|
+ rev = "a92f64aa397888975162d9296ed79fbce903fb7f";
|
|
|
+ sha256 = "sha256-kcKbkPyOW19bK4tYk0ylzvZePTApr/KHG4+ae7wxf6Q=";
|
|
|
+ };
|
|
|
+ in {
|
|
|
+ postInstall = ''
|
|
|
+ rm -r $out/queries
|
|
|
+ mkdir $out/queries
|
|
|
+ cp -r ${nvimSvelteSrc}/queries/svelte5 $out/queries/svelte
|
|
|
+ ls -la $out
|
|
|
+ '';
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
buildTreesitterPlugin = name: spec:
|
|
|
let
|
|
|
nameParts = builtins.split "/" (spec.repo or "tree-sitter/tree-sitter-${name}");
|
|
|
@@ -19,7 +37,7 @@ let
|
|
|
};
|
|
|
} // lib.optionalAttrs (builtins.hasAttr "path" spec) {
|
|
|
location = spec.path;
|
|
|
- });
|
|
|
+ } // (overrides.${name} or {}));
|
|
|
|
|
|
initLua = ''
|
|
|
vim.treesitter.language.register('${name}', { ${lib.concatMapStringsSep ", " (filetype: "'${filetype}'") filetypes} })
|