From b3b3595482ff92793dd2e6a8f065685e97056d78 Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Thu, 11 Jul 2024 16:48:52 +0200 Subject: [PATCH] qmlls client: re-engage lsp semantic highlighting Task-number: QTBUG-126550 Task-number: QTCREATORBUG-31102 Change-Id: I63c1ea4825ad5b8d71c4fd6c89b94ad90f127e4b Reviewed-by: Ulf Hermann --- src/plugins/qmljseditor/qmljseditordocument.cpp | 9 ++++----- src/plugins/qmljseditor/qmllsclient.cpp | 5 ----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 72b41700016..91c0fba3b43 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -732,11 +732,10 @@ void QmlJSEditorDocumentPrivate::setSourcesWithCapabilities( setSemanticWarningSource(QmllsStatus::Source::Qmlls); else setSemanticWarningSource(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); + if (cap.semanticTokensProvider()) + setSemanticHighlightSource(QmllsStatus::Source::Qmlls); + else + setSemanticHighlightSource(QmllsStatus::Source::EmbeddedCodeModel); } static FilePath qmllsForFile(const FilePath &file, QmlJS::ModelManagerInterface *modelManager) diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index ce72cf7977c..bb5195ce91d 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -85,11 +85,6 @@ QmllsClient::~QmllsClient() void QmllsClient::startImpl() { - LanguageServerProtocol::Unregistration unregister; - unregister.setMethod("textDocument/semanticTokens"); - unregister.setId({}); - dynamicCapabilities().unregisterCapability({unregister}); - Client::startImpl(); }