13 # based on https://github.com/NixOS/nixpkgs/blob/aa07b78b9606daf1145a37f6299c6066939df075/pkgs/development/tools/parsing/tree-sitter/default.nix#L85-L104
17 grammars = grammarFn tree-sitter.builtGrammars;
23 name = lib.strings.getName drv;
26 name = "lib" + (lib.strings.removeSuffix "-grammar" name) + ".so";
27 path = "${drv}/parser";
32 libPath = withPlugins (_: tree-sitter.allGrammars);
34 rustPlatform.buildRustPackage rec {
38 src = fetchFromGitHub {
39 owner = "afnanenayet";
42 hash = "sha256-ta7JcSPEgpJwieYvtZnNMFvsYvz4FuxthhmKMYe2XUE=";
43 fetchSubmodules = false;
46 cargoHash = "sha256-VbdV4dftCxxKLJr9TEuCe9tvSGbc62AUwlDZdaNRNhw=";
48 buildNoDefaultFeatures = true;
50 "dynamic-grammar-libs"
57 nativeInstallCheckInputs = [
60 doInstallCheck = true;
63 # completions are not yet implemented
64 # so we can safely remove this without installing the completions
65 rm $out/bin/diffsitter_completions
67 wrapProgram "$out/bin/diffsitter" \
68 --prefix LD_LIBRARY_PATH : "${libPath}"
73 # tests::diff_hunks_snapshot::_medium_cpp_cpp_false_expects
74 # tests::diff_hunks_snapshot::_medium_cpp_cpp_true_expects
75 # tests::diff_hunks_snapshot::_medium_rust_rs_false_expects
76 # tests::diff_hunks_snapshot::_medium_rust_rs_true_expects
77 # tests::diff_hunks_snapshot::_short_python_py_true_expects
78 # tests::diff_hunks_snapshot::_short_rust_rs_true_expects
80 passthru.updateScript = gitUpdater { rev-prefix = "v"; };
83 homepage = "https://github.com/afnanenayet/diffsitter";
84 description = "Tree-sitter based AST difftool to get meaningful semantic diffs";
85 license = licenses.mit;
86 maintainers = with maintainers; [ bbigras ];