Monday 5 July 2021

Is Monaco Diff Editor capable for Diff data format as input?

I'm referring to the Monaco Diff Editor: Just scroll down on: https://microsoft.github.io/monaco-editor/index.html

As shown in the official code example (https://github.com/microsoft/monaco-editor-samples/blob/master/browser-amd-diff-editor/index.html) the model expects two models as inputs: One model of the original data and one model of the data to be compared with:

            diffEditor.setModel({
                original: monaco.editor.createModel(originalTxt, 'javascript'),
                modified: monaco.editor.createModel(modifiedTxt, 'javascript'),
            })

My question is: Is it also possible to pass an already created diff instead of the original and modified data? Something like:

--- /srv/qc/reference.xml   2019-05-16 08:30:10.837000000 +0000
+++ /srv/qc/candidate.xml   2019-05-16 08:30:10.833000000 +0000
@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <root-element xmlns="http://www.example.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemaLocation="http://www.example.com callback_reply.xsd">
   <reply>
     <status code="10301" severity="I" msg="DemoDCP called"/>
     <dataApp>
       <var id="ZZ_ZZ_ZZ_TXV_CONTACT_CITY" f="X" v="Stuttgart"/>
       <var id="ZZ_ZZ_ZZ_TXV_CONTACT_ZIP_CODE" f="X" v="70178"/>
       <var id="ZZ_ZZ_ZZ_TXV_CONTACT_COUNTRY" f="X" v="Deutschland"/>
-      <var id="ZZ_ZZ_ZZ_TXV_CONTACT_GENDER" f="X" v="f"/>
+      <var id="ZZ_ZZ_ZZ_TXV_CONTACT_GENDER" f="X" v="m"/>
       <var id="ZZ_ZZ_ZZ_TXV_CONTACT_PHONE" f="X" v="#PHONE Value#"/>
       <var id="ZZ_ZZ_ZZ_TXV_CONTACT_FAX" f="X" v="#FAX Value#"/>
       <var id="ZZ_ZZ_ZZ_TXV_CONTACT_EMAIL" f="X" v="#EMAIL Value#"/>
-      <var id="ZZ_ZZ_ZZ_TXV_CONTACT_ROLE" f="X" v="VP2"/>
+      <var id="ZZ_ZZ_ZZ_TXV_CONTACT_ROLE" f="X" v="VP1"/>
     </dataApp>
   </reply>
 </root-element>


from Is Monaco Diff Editor capable for Diff data format as input?

No comments:

Post a Comment