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 <sami.shalayel@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Semih Yavuz
2024-06-20 15:36:23 +02:00
parent d8fa27cfbb
commit df2e55d92a
2 changed files with 9 additions and 4 deletions

View File

@@ -728,9 +728,10 @@ void QmlJSEditorDocumentPrivate::setSourcesWithCapabilities(
setSemanticWarningSource(QmllsStatus::Source::Qmlls); setSemanticWarningSource(QmllsStatus::Source::Qmlls);
else else
setSemanticWarningSource(QmllsStatus::Source::EmbeddedCodeModel); setSemanticWarningSource(QmllsStatus::Source::EmbeddedCodeModel);
if (cap.semanticTokensProvider()) // TODO: uncomment when qmlls semantic tokens reach a stable state
setSemanticHighlightSource(QmllsStatus::Source::Qmlls); // if (cap.semanticTokensProvider())
else // setSemanticHighlightSource(QmllsStatus::Source::Qmlls);
// else
setSemanticHighlightSource(QmllsStatus::Source::EmbeddedCodeModel); setSemanticHighlightSource(QmllsStatus::Source::EmbeddedCodeModel);
} }

View File

@@ -66,6 +66,10 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls)
QmllsClient::QmllsClient(StdIOClientInterface *interface) QmllsClient::QmllsClient(StdIOClientInterface *interface)
: Client(interface) : Client(interface)
{ {
LanguageServerProtocol::Unregistration unregister;
unregister.setMethod("textDocument/semanticTokens");
unregister.setId({});
dynamicCapabilities().unregisterCapability({unregister});
} }
QmllsClient::~QmllsClient() QmllsClient::~QmllsClient()