From 6cb958de9ac09f5317fdbbd40f825c0ad86cc555 Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Tue, 16 Jul 2024 16:20:30 +0200 Subject: [PATCH] Export SemanticTokenSupport This class manages the semantic token functionality for LSP clients. Since clients might need to modify or customize its internals, we should make it accessible to other libraries. Task-number: QTBUG-126550 Task-number: QTCREATORBUG-31102 Change-Id: I3957197ce48faac90efedac1a42b763ba2b7b4d1 Reviewed-by: David Schulz Reviewed-by: Fabian Kosmale Reviewed-by: Sami Shalayel --- src/plugins/languageclient/client.cpp | 5 +++++ src/plugins/languageclient/client.h | 1 + src/plugins/languageclient/semantichighlightsupport.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index ee3d3632fe4..0f6a3ce9035 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1815,6 +1815,11 @@ HoverHandler *Client::hoverHandler() return &d->m_hoverHandler; } +SemanticTokenSupport *Client::semanticTokenSupport() +{ + return &d->m_tokenSupport; +} + void ClientPrivate::log(const ShowMessageParams &message) { q->log(message.toString()); diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index ec4c7c26854..57b49463915 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -165,6 +165,7 @@ public: LinkTarget target); DocumentSymbolCache *documentSymbolCache(); HoverHandler *hoverHandler(); + SemanticTokenSupport *semanticTokenSupport(); QList diagnosticsAt(const Utils::FilePath &filePath, const QTextCursor &cursor) const; bool hasDiagnostic(const Utils::FilePath &filePath, diff --git a/src/plugins/languageclient/semantichighlightsupport.h b/src/plugins/languageclient/semantichighlightsupport.h index bf8331aa9e9..25248ab1e93 100644 --- a/src/plugins/languageclient/semantichighlightsupport.h +++ b/src/plugins/languageclient/semantichighlightsupport.h @@ -39,7 +39,7 @@ public: using SemanticTokensHandler = std::function &, int, bool)>; -class SemanticTokenSupport : public QObject +class LANGUAGECLIENT_EXPORT SemanticTokenSupport : public QObject { public: explicit SemanticTokenSupport(Client *client);