{"repo":"afnanenayet/diffsitter","free":true,"listed":false,"github":"https://github.com/afnanenayet/diffsitter","clone":"git clone https://github.com/afnanenayet/diffsitter.git","description":"A tree-sitter based AST difftool to get meaningful semantic diffs","language":"Rust","stars":2395,"topics":["diff","ast","rust","tree-sitter","parser"],"license":"MIT","category":"dev-tools","readme_excerpt":"diffsitter Disclaimer diffsitter is very much a work in progress and nowhere close to production ready (yet). Contributions are always welcome! Summary diffsitter creates semantically meaningful diffs that ignore formatting differences like spacing. It does so by computing a diff on the AST (abstract syntax tree) of a file rather than computing the diff on the text contents of the file. diffsitter uses the parsers from the tree-sitter project to parse source code. As such, the languages supported by this tool are restricted to the languages supported by tree-sitter. diffsitter supports the following languages: Bash C# C++ CSS Go Java OCaml PHP Python Ruby Rust Typescript/TSX HCL Examples Take the following files: a.rs b.rs The standard output from diff will get you: You can see that it picks up the formatting differences for the main function, even though they aren't semantically different. Check out the output from diffsitter : Note: the numbers correspond to line numbers from the original files. You can also filter which tree sitter nodes are considered in the diff through the config file. Since it uses the AST to calculate the difference, it knows that the formatting differences in main between the two files isn't a meaningful difference, so it doesn't show up in the diff. diffsitter has some nice (terminal aware) formatting too: It also has extensive logging if you want to debug or see timing information: Node filtering You can filter the nodes that are considered in the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/afnanenayet","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/afnanenayet/diffsitter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}