Sysmagine / SemanticDiff

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

Support for xml files #18

Open cscotti opened 1 year ago

cscotti commented 1 year ago

It would be nice if you could implement xml support in order to compare version ? Actually, we get "Unsupported language: xml" message

mmueller2012 commented 1 year ago

Can you tell me a bit more about your use case? What kind of XML files do you use and which changes do you want SemanticDiff to hide?

The issue with XML is that the spec only defines when a file is well formed. It doesn't really specify what changes you can make without changing the meaning. While most applications will just work fine if you reorder children inside of a parent or add additional whitespace for readability, this technically modifies the content. The only exception are attributes which you can reorder according to the spec. It is therefore difficult to implement a generic XML mode.

ebw44 commented 10 months ago

XML support would be useful in the case of Twincat files. Twincat is a software for automation software by Beckhoff, and save configuration as well as code into xml files. It has the tendency to modify these xml files for no reasons which makes source control of your project painful. Here are a few examples of what can happen and result in diff in regular text based diff:

GeirGrusom commented 7 months ago

I find that XML files is something most diff tools do poorly. I often encounter issues when merging lists that contain the same element multiple times:

<foo>
  <bar>
  </bar>
  <bar>
  </bar>
</foo>

When there is a merge conflict with a <bar> it's an easy mistake to end up with two </bar> right after each other since diff tools don't understand/care that the order matters.

For me the place I most often encounter this is in C# project files, and Visual Studio solution files.

MakotoE commented 6 months ago

I often change the white spacing in XML files - whether tabs or newlines. If SemanticDiff supports XML files, it would greatly help me ignore whitespace changes.