From df2e55d92a78e2e571f714fb2fc25478da5e0525 Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Thu, 20 Jun 2024 15:36:23 +0200 Subject: [PATCH] Opt out qmlls semantic highlighting Apperantly, qmlls semantic highlighting is not as powerful as the embedded code model's highlighter. Disable lsp based highlighting until qmlls semantic highlighting reaches the feature parity with the QtC highlighter. This is tracked by QTBUG-126550. Task-number: QTBUG-126550 Fixes: QTCREATORBUG-31083 Change-Id: I6cab94d4ba1d1cde50b62ce03a6b1cc5b6d7d27b Reviewed-by: Sami Shalayel Reviewed-by: David Schulz --- src/plugins/qmljseditor/qmljseditordocument.cpp | 9 +++++---- src/plugins/qmljseditor/qmllsclient.cpp | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 3dfb9b8f137..2d537422daf 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -728,10 +728,11 @@ void QmlJSEditorDocumentPrivate::setSourcesWithCapabilities( setSemanticWarningSource(QmllsStatus::Source::Qmlls); else setSemanticWarningSource(QmllsStatus::Source::EmbeddedCodeModel); - if (cap.semanticTokensProvider()) - setSemanticHighlightSource(QmllsStatus::Source::Qmlls); - else - setSemanticHighlightSource(QmllsStatus::Source::EmbeddedCodeModel); + // TODO: uncomment when qmlls semantic tokens reach a stable state + // if (cap.semanticTokensProvider()) + // setSemanticHighlightSource(QmllsStatus::Source::Qmlls); + // else + setSemanticHighlightSource(QmllsStatus::Source::EmbeddedCodeModel); } static Utils::FilePath qmllsForFile(const Utils::FilePath &file, diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 6ec46774f30..9fe50a5af7e 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -66,6 +66,10 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls) QmllsClient::QmllsClient(StdIOClientInterface *interface) : Client(interface) { + LanguageServerProtocol::Unregistration unregister; + unregister.setMethod("textDocument/semanticTokens"); + unregister.setId({}); + dynamicCapabilities().unregisterCapability({unregister}); } QmllsClient::~QmllsClient()