diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 1bec169fe1e..de977d9cff1 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -765,7 +765,7 @@ void QmlJSEditorDocumentPrivate::settingsChanged() return; FilePath newQmlls = qmllsForFile(q->filePath(), ModelManagerInterface::instance()); - if (m_qmllsStatus.qmllsPath == newQmlls) { + if (!newQmlls.isEmpty() && m_qmllsStatus.qmllsPath == newQmlls) { if (QmllsClient *client = QmllsClient::clientForQmlls(newQmlls)) { client->updateQmllsSemanticHighlightingCapability(); setSourcesWithCapabilities(client->capabilities()); @@ -781,9 +781,7 @@ void QmlJSEditorDocumentPrivate::settingsChanged() if (LanguageClientManager::clientForDocument(q) != nullptr) { qCDebug(qmllsLog) << "deactivating " << q->filePath() << "in qmlls" << newQmlls; LanguageClientManager::openDocumentWithClient(q, nullptr); - } else - qCWarning(qmllsLog) << "Could not find client to disable for document " << q->filePath() - << " in LanguageClient::LanguageClientManager"; + } setCompletionSource(QmllsStatus::Source::EmbeddedCodeModel); setSemanticWarningSource(QmllsStatus::Source::EmbeddedCodeModel); setSemanticHighlightSource(QmllsStatus::Source::EmbeddedCodeModel); diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 1fdc30a124a..3129fec7df5 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -45,6 +45,7 @@ static QHash &qmllsClients() QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls) { + QTC_ASSERT(!qmlls.isEmpty(), return nullptr); if (auto client = qmllsClients()[qmlls]) { switch (client->state()) { case Client::State::Uninitialized: