Sysmagine / SemanticDiff

Community support for SemanticDiff, the programming language aware diff for Visual Studio Code and GitHub.
https://semanticdiff.com
49 stars 0 forks source link

JSON support: doesn't hide non-semantic changes #10

Closed cunneen closed 10 months ago

cunneen commented 1 year ago

Describe the Bug A clear and concise description of what the bug is.

When JSON files have the sequence of their properties changed without any semantic changes, semanticdiff is highlighting them as changes. The JSON standard specifies that object properties are unordered; some of the tools we use

To Reproduce Open the diff for JSON file with only the property order changed.

Expected Behavior non-semantic changes are not highlighted

Actual Behavior See screenshot

Screenshots

Screenshot 2023-03-22 at 6 15 03 pm

Source Code n/a

SemanticDiff Version v0.8.2

VS Code Information Simply click Help -> About -> Copy in VS Code and paste the information:


Version: 1.76.2
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:53:46.528Z (1 wk ago)
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.2.0
Sandboxed: No

Additional Context n/a

slackner commented 1 year ago

Thanks for the report!

Looks like the re-ordering changes are considered "too significant" to match corresponding key/value pairs correctly.

I'll try to reproduce this with a smaller example and get back to with more detail soon.

cunneen commented 1 year ago

Thanks! For the record, we often need to compare json files that have been parsed by a tool and later reserialised, and it would be super useful if we were able to do a semantic comparison within vscode with such property reordering not highlighted at all. Currently we are copying and pasting into jsondiff.com to achieve this.

mmueller2012 commented 1 year ago

@cunneen We just released a new version of SemanticDiff that handles JSON much better. Can you give it a try and check if it solves your problem? You might want to check that you actually have version 0.8.7 installed (open the extension tab and hover over SemanticDiff) since we pushed the update literally a few minutes ago.

mmueller2012 commented 10 months ago

Closing this bug since it has been fixed for a while. @cunneen please reopen if you run into any issues.