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 1b57e95c14.

Change-Id: Ie22765aecea2816560488d21b2d355ba96ff3589
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2024-10-17 14:57:53 +02:00
parent e3209d3b60
commit 985ad0ecd9

View File

@@ -7,6 +7,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/idocument.h> #include <coreplugin/idocument.h>
#include <projectexplorer/buildsystem.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectmanager.h> #include <projectexplorer/projectmanager.h>
@@ -125,8 +126,13 @@ void QmlTaskManager::updateSemanticMessagesNow()
if (!project) if (!project)
return; return;
BuildSystem *buildSystem = ProjectManager::startupBuildSystem();
if (!buildSystem)
return;
const bool isCMake = buildSystem->name() == "cmake";
// heuristic: qmllint will output meaningful warnings if qmlls is enabled // 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 // abort any update that's going on already, and remove old codemodel warnings
m_messageCollector.cancel(); m_messageCollector.cancel();
removeAllTasks(true); removeAllTasks(true);