restart qmlls after a build

Slightly related to QTCREATORBUG-24428 about resetting the codemodel
after build so it can find the generated *.qmltypes from the
buildfolder:
Restart qmlls clients after builds to force qmlls to
re-scan the build folder (and eventually find new qmldir, qmltypes,
QML modules, etc generated by the CMake scripts during the build).

Task-number: QTCREATORBUG-24428
Change-Id: I568401050586358ac085cf2c30236a5a0a91a944
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Sami Shalayel
2024-08-20 17:59:02 +02:00
parent 4cbede6fd1
commit 2f320436d3

View File

@@ -9,6 +9,8 @@
#include <languageclient/languageclientinterface.h> #include <languageclient/languageclientinterface.h>
#include <languageclient/languageclientmanager.h> #include <languageclient/languageclientmanager.h>
#include <projectexplorer/buildmanager.h>
#include <texteditor/textdocument.h> #include <texteditor/textdocument.h>
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
@@ -68,6 +70,12 @@ QmllsClient::QmllsClient(StdIOClientInterface *interface)
: Client(interface) : Client(interface)
{ {
setSnippetsGroup(QmlJSEditor::Constants::QML_SNIPPETS_GROUP_ID); setSnippetsGroup(QmlJSEditor::Constants::QML_SNIPPETS_GROUP_ID);
connect(
ProjectExplorer::BuildManager::instance(),
&ProjectExplorer::BuildManager::buildQueueFinished,
this,
[this]() { LanguageClientManager::restartClient(this); });
} }
QmllsClient::~QmllsClient() QmllsClient::~QmllsClient()