We need to write out the Dom back to QML after in memory modifications.
Unfortunately the approach taken by qmlformat is a bit a dead end mainly because:
- it cannot reformat a prt of the document, or a code snippet
- it cannot reindent part of the document keeping in account the choices done by the user in the rest
These two features are needed by the LSP, and a rewriter able to do these can do a global reformatting, whereas the opposite is not true.
Fortunately the Qmljs library in creator has these, but lot of the reindenting is tightly connected to Qt/Creator (QTextBlock,...).
So one should abstract away those parts and bring them to the Dom to avoid having duplicated code later.