QmlDesigner: Add link error switch in RewriterView

Add a switch in RewriterView to disable link error checks.

Change-Id: I6bac2c6c92872463c2246e67e803a6724973fae7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2022-11-09 13:50:01 +01:00
committed by Henning Gründl
parent cf86bc789f
commit f7e7bcd877
2 changed files with 12 additions and 7 deletions

View File

@@ -127,11 +127,13 @@ public:
QString convertTypeToImportAlias(const QString &type) const;
bool checkSemanticErrors() const
{ return m_checkErrors; }
bool checkSemanticErrors() const { return m_checkSemanticErrors; }
void setCheckSemanticErrors(bool b)
{ m_checkErrors = b; }
void setCheckSemanticErrors(bool b) { m_checkSemanticErrors = b; }
bool checkLinkErrors() const { return m_checkLinkErrors; }
void setCheckLinkErrors(bool b) { m_checkLinkErrors = b; }
QString pathForImport(const Import &import);
@@ -191,7 +193,8 @@ private: //variables
TextModifier *m_textModifier = nullptr;
int transactionLevel = 0;
bool m_modificationGroupActive = false;
bool m_checkErrors = true;
bool m_checkSemanticErrors = true;
bool m_checkLinkErrors = true;
DifferenceHandling m_differenceHandling;
QScopedPointer<Internal::ModelNodePositionStorage> m_positionStorage;

View File

@@ -1139,8 +1139,10 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
m_scopeChain = QSharedPointer<const ScopeChain>(
new ScopeChain(ctxt.scopeChain()));
if (view()->checkLinkErrors()) {
qCInfo(rewriterBenchmark) << "linked:" << time.elapsed();
collectLinkErrors(&errors, ctxt);
}
setupPossibleImports(snapshot, m_vContext);