We have just released version 0.8.8 of SemanticDiff - our programming language aware diff for Visual Studio Code and GitHub. This update introduces support for diffing Rust files and provides minor improvements for other supported languages.
If you are using the GitHub App, all updates have already been rolled out and no action is required on your part. VS Code users should receive the update automatically when the editor checks for extension updates.
The most significant change in SemanticDiff 0.8.8 is that it can now generate programming language aware diffs for Rust. You can now reformat your code with
rustfmt and SemanticDiff should display an empty diff as it ignores style-only changes. This is especially useful if your files also contain other modifications that would be easily missed in a standard diff amidst all the format changes.
Here are a some screenshots to demonstrate what it looks like. Let’s start with a very simple toy example:
SemanticDiff can also distinguish between stylistic changes and logic changes in less obvious cases:
The full list of invariances (i.e. changes that are not displayed in the diff) includes:
- Adding/Removing whitespaces or line breaks outside of strings and comments
- Adding/Removing optional commas
- Adding/Removing unnecessary parenthesis
- Exchanging numeric literals with equivalent ones in different bases
- Exchanging escaped characters in a string/char with an equivalent representation (e.g. the literal)
- Exchanging the deprecated
...range operator with
As with any other supported language, SemanticDiff can also detect and highlight moved code blocks in Rust:
Since the Rust language syntax is still evolving, SemanticDiff may not yet support all recent additions. We focus on the stable syntax and only pull in a few selected RFCs from Rust nightly. If your project requires a language feature not yet supported, feel free to open an issue.
The addition of Rust was not the only language related change in SemanticDiff 0.8.8. Here is a list of the remaining changes:
- Python: Improved handling of indentation changes
- Support for base conversions of integer literals with a postfix (e.g.
- C#: Treat swapping an explicit parameter list (
(x) => x) with an implicit parameter (
x => x) as invariant
- Fixed a bug that aborted the diff computation when a certain type of change occurred in a moved code block
- Fixed highlighting of characters in the supplementary Unicode planes
- Improved detection of moved code blocks
- CSS: Improved parsing
We have also improved the onboarding experience for our Visual Studio Code extension. The first time you install SemanticDiff, a step-by-step guide will open to help you get started. If you need more information, don’t forget to check out our documentation.
If you follow our release announcements or scroll through the VS Code extension changelog, you may notice that the number of new features per release is currently decreasing. This is intentional as we prepare for the SemanticDiff 1.0.0 release and focus more on quality and performance improvements. We only have a few items left on our TODO list that we would like to finish before the release. So expect one or maybe two more beta releases.
We hope you enjoyed this update. If you encounter any issues, please let us know in our issue tracker.