From 985ad0ecd9fc365f8b17f5aa953b7d860b906433 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 17 Oct 2024 14:57:53 +0200 Subject: [PATCH] QmlJSEditor: Fix running QML/JS checks For non-CMake based projects with enabled qmlls the checks just do nothing as the qmllint target does not get created elsewhere and an early return prevents the fallback in such case. Limit the usage of qmllint to cmake based projects to be able to use the fallback for other build systems. Regression introduced with 1b57e95c14d78119bbf8358bb52dfc1be0cde140. Change-Id: Ie22765aecea2816560488d21b2d355ba96ff3589 Reviewed-by: Christian Kandeler --- src/plugins/qmljseditor/qmltaskmanager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmltaskmanager.cpp b/src/plugins/qmljseditor/qmltaskmanager.cpp index 7bb85d9acca..87cf9efb269 100644 --- a/src/plugins/qmljseditor/qmltaskmanager.cpp +++ b/src/plugins/qmljseditor/qmltaskmanager.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -125,8 +126,13 @@ void QmlTaskManager::updateSemanticMessagesNow() if (!project) return; + BuildSystem *buildSystem = ProjectManager::startupBuildSystem(); + if (!buildSystem) + return; + + const bool isCMake = buildSystem->name() == "cmake"; // heuristic: qmllint will output meaningful warnings if qmlls is enabled - if (QmllsSettingsManager::instance()->useQmlls(project)) { + if (isCMake && QmllsSettingsManager::instance()->useQmlls(project)) { // abort any update that's going on already, and remove old codemodel warnings m_messageCollector.cancel(); removeAllTasks(true);