Type: Technical task
Priority: P2: Important
Fix Version/s: None
Component/s: QML: Tooling
Implement QmlDom in Qt that can serve as a replacement for big parts of the QML rewriter in Qt Creator/Qt Quick Designer.
The QMLDom should have a public API
If the Qt Quick Designer is not supposed to interact with the 'private' AST directly, the only natural solution I currently see is a QMLDom.
This QMLDom provides read/write functionality for QML files/text buffers, similar to an XML Dom. The QMLDom would interact with the QML code model and provide also type information.
The availability of a public QMLDom would make developing tools around QML a lot easier. Tools that generate QML from third-party data could use it and also tools for verifying QML would heavily benefit from a public QMLDom.
The user could write powerful QML generation or verification tools on top of QMLDom.
Most of the heavy lifting of the Rewriter in the Qt Quick Designer would have to be done by the QMLDom, though.
Qt Quick Designer would benefit heavily from such a QMLDom with a well maintained public API. Updates of the AST, language would not directly impact Qt Creator and Qt Quick Designer anymore.
Rewriting The question is how well such a QMLDom has to maintain the QML. The current Rewriter does strict rewriting and does only touch changed QML code. How strict the QMLDom would support rewriting can be discussed.
Things like comments and property order should be preserved.