Interface
function diffModelicaFileListings
input String before;
input String after;
input DiffFormat diffFormat = DiffFormat.color;
input Boolean failOnSemanticsChange = false "Defaults to returning after instead of hard fail";
output String result;
end diffModelicaFileListings;
Creates diffs of two strings (before and after) corresponding to Modelica files. The diff is specialized to handle the [list](https://build.openmodelica.org/Documentation/OpenModelica.Scripting.list.html) API moving comments around in the file and introducing or deleting whitespace.
The output can be chosen to be a colored diff (for terminals), XML, or the final text (deletions removed).
OpenModelica has:
The same functionality would be good to have in the language server. We have testcases in https://github.com/OpenModelica/OpenModelica/tree/master/testsuite/openmodelica/diff
And the implementation is in:
https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/Compiler/Parsers/SimpleModelicaParser.mo
https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/Compiler/Util/DiffAlgorithm.mo
The grammar itself should not be all too dissimilar to the tree sitter grammar