From 04c2546b82d0609fcaab2e792e2b1e0794dca9eb Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Tue, 11 May 2021 17:36:08 +0200 Subject: qmllint: Add inline component support Adds support for inline components for qmllint with a few things not working yet: - Two inline components referencing each other - Using inline components before they are declared These two issues require a larger overhaul of qmllint as a whole and will be addressed in a different change. Change-Id: I2834702c21a8eb728db4709d6f475c33796b3e4d Reviewed-by: Ulf Hermann --- tools/qmllint/findwarnings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index 4041cac8df..ce78d8285b 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -144,7 +144,8 @@ void FindWarningVisitor::flushPendingSignalParameters() void FindWarningVisitor::checkDefaultProperty(const QQmlJSScope::ConstPtr &scope) { - if (scope == m_exportedRootScope || scope->isArrayScope()) // inapplicable + if (scope == m_exportedRootScope || scope->isArrayScope() + || scope->isInlineComponent()) // inapplicable return; // These warnings do not apply for custom parsers and their children and need to be handled on a @@ -670,8 +671,9 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiPublicMember *uipb) if (uipb->type == QQmlJS::AST::UiPublicMember::Property && uipb->memberType != nullptr && !uipb->memberType->name.isEmpty() && uipb->memberType->name != QLatin1String("alias")) { const auto name = uipb->memberType->name.toString(); - if (m_importTypeLocationMap.contains(name)) { - m_usedTypes.insert(name); + if (m_rootScopeImports.contains(name) && !m_rootScopeImports[name].isNull()) { + if (m_importTypeLocationMap.contains(name)) + m_usedTypes.insert(name); } else { m_logger.log(name + QStringLiteral(" was not found. Did you add all import paths?"), Log_Import); -- cgit v1.2.3