diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2023-11-20 17:09:13 +0100 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2023-11-28 12:33:27 +0100 |
commit | da693f932e948c960526140d5701698a53155f23 (patch) | |
tree | 4e052cdd9fe5625756f59b966e6a0afa2d7bcac8 /src/qml/parser | |
parent | f4c13d1b738d25c563d00c0bc25e720775d985a3 (diff) |
qqmljs.g: add option to disable automatic identifier insertion
Add a RecoveryOption enum that can be passed to QmlFile's constructor to
enable or disable recovery.
Extend DomCreationOption by another value WithRecovery, such that
users of the Dom can enable recovery via the FileToLoad argument of the
Dom's file to load.
Enable the recovery in the qqmlcodemodel for qmlls.
The actual recovery is implemented in a separate commit in the relation
chain.
Task-number: QTBUG-115836
Change-Id: Icb6b115cf667c77c596fa335bc37bb12bf680cce
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser')
-rw-r--r-- | src/qml/parser/qqmljs.g | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index 0b7a38c4a5..80225a87dc 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -302,6 +302,12 @@ public: inline int errorColumnNumber() const { return diagnosticMessage().loc.startColumn; } + inline bool identifierInsertion() const + { return m_enableIdentifierInsertion; } + + inline void enableIdentifierInsertion() + { m_enableIdentifierInsertion = true; } + protected: bool parse(int startToken); @@ -390,6 +396,7 @@ protected: CoverExpressionType coverExpressionType = CE_Invalid; QList<DiagnosticMessage> diagnostic_messages; + bool m_enableIdentifierInsertion = false; }; } // end of namespace QQmlJS |