diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-04-30 10:02:23 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-05-03 08:40:50 +0200 |
commit | 56c16d0e9770b39df142ba946357562be6b9731c (patch) | |
tree | 194f42794e5d132d19d0c41837d771d49ed42c10 /tools | |
parent | 3464655f5e2adaa1aed8925a9a54b8fb5f238f31 (diff) |
qmllint: Exclude children of custom parser elements from warnings
Some warnings caused by the children of custom parser elements also need to be ignored.
Change-Id: Iff3c6e5ce2ea334c6de7a14c8592ee1ebf80bb58
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmllint/findwarnings.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index 3d0cedc393..4041cac8df 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -99,6 +99,11 @@ void FindWarningVisitor::checkInheritanceCycle(QQmlJSScope::ConstPtr scope) void FindWarningVisitor::checkGroupedAndAttachedScopes(QQmlJSScope::ConstPtr scope) { + // These warnings do not apply for custom parsers and their children and need to be handled on a + // case by case basis + if (scope->isInCustomParserParent()) + return; + auto children = scope->childScopes(); while (!children.isEmpty()) { auto childScope = children.takeFirst(); @@ -142,6 +147,11 @@ void FindWarningVisitor::checkDefaultProperty(const QQmlJSScope::ConstPtr &scope if (scope == m_exportedRootScope || scope->isArrayScope()) // inapplicable return; + // These warnings do not apply for custom parsers and their children and need to be handled on a + // case by case basis + if (scope->isInCustomParserParent()) + return; + const QQmlJSScope *scopeOfDefaultProperty = nullptr; QString defaultPropertyName; // NB: start looking for default property in parent scope (because this @@ -288,9 +298,10 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiScriptBinding *uisb) } if (!qmlScope->hasProperty(name.toString())) { - // These warnings do not apply for custom parsers and need to be handled on a case by - // case basis - if (qmlScope->baseType()->hasCustomParser()) + // These warnings do not apply for custom parsers and their children and need to be + // handled on a case by case basis + + if (qmlScope->isInCustomParserParent()) return true; // TODO: Can this be in a better suited category? |