Add imara-diff v0.2 with slider heuristics support - #2286
Conversation
| /// // The diff now has slider heuristics applied | ||
| /// assert_eq!(diff.count_removals(), 1); | ||
| /// assert_eq!(diff.count_additions(), 1); |
There was a problem hiding this comment.
Sebastian Thiel (@Byron) Counting removals and additions probably is not the best example to showcase slider heuristics as line numbers are not affected by moving sliders up and down. :-)
- Add imara-diff v0.2.0 as dependency alongside v0.1.8 - Expose v0.2 API through blob::v0_2 module - Add diff_with_slider_heuristics() function for convenient usage - Add comprehensive tests demonstrating UnifiedDiffPrinter usage - Tests cover various scenarios including multi-hunk diffs and custom context sizes Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
51ca834 to
4d3a6b1
Compare
|
Alright, Christoph Rüßler (@cruessler), I have worked it over and think v2 is good as experimental feature to play around with. The integration tests are a test-bed on its own, but I think now it's more straightforward to try it with Performance would be interesting, and the usability of the unified diff printer, which desperately misses I hope this helps 🙏 |
Adds imara-diff v0.2 alongside existing v0.1 to provide Git's slider heuristics for more intuitive diff placement.
Changes
imara-diff-v0_2(v0.2.0) alongside existing v0.1.8blob::v0_2module (Diff,UnifiedDiffPrinter,IndentHeuristic, etc.)diff_with_slider_heuristics()that computes and postprocesses diffs in one callUnifiedDiffPrinterusage, custom heuristics, and hunk iterationUsage
Maintains full backward compatibility with existing v0.1 API.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.