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 <david.schulz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit is contained in:
Semih Yavuz
2024-07-16 16:20:30 +02:00
parent 52abfab8a4
commit 6cb958de9a
3 changed files with 7 additions and 1 deletions

View File

@@ -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());

View File

@@ -165,6 +165,7 @@ public:
LinkTarget target);
DocumentSymbolCache *documentSymbolCache();
HoverHandler *hoverHandler();
SemanticTokenSupport *semanticTokenSupport();
QList<LanguageServerProtocol::Diagnostic> diagnosticsAt(const Utils::FilePath &filePath,
const QTextCursor &cursor) const;
bool hasDiagnostic(const Utils::FilePath &filePath,

View File

@@ -39,7 +39,7 @@ public:
using SemanticTokensHandler = std::function<void(TextEditor::TextDocument *,
const QList<ExpandedSemanticToken> &, int, bool)>;
class SemanticTokenSupport : public QObject
class LANGUAGECLIENT_EXPORT SemanticTokenSupport : public QObject
{
public:
explicit SemanticTokenSupport(Client *client);