LSP: add semantic tokens

Change-Id: Ia6865ec6991ec62ae9f0dc2dfa692f1f27318ed1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-02-25 12:54:14 +01:00
parent 9c2980f65d
commit f1bb3b6811
15 changed files with 1073 additions and 37 deletions

View File

@@ -37,6 +37,7 @@
#include "languageclientsettings.h"
#include "languageclientsymbolsupport.h"
#include "progressmanager.h"
#include "semantichighlightsupport.h"
#include <coreplugin/messagemanager.h>
@@ -49,6 +50,7 @@
#include <languageserverprotocol/languagefeatures.h>
#include <languageserverprotocol/messages.h>
#include <languageserverprotocol/progresssupport.h>
#include <languageserverprotocol/semantictokens.h>
#include <languageserverprotocol/shutdownmessages.h>
#include <languageserverprotocol/textsynchronization.h>
@@ -201,6 +203,9 @@ private:
void updateFunctionHintProvider(TextEditor::TextDocument *document);
void requestDocumentHighlights(TextEditor::TextEditorWidget *widget);
LanguageServerProtocol::SemanticRequestTypes supportedSemanticRequests(TextEditor::TextDocument *document) const;
void requestSemanticTokens(TextEditor::TextEditorWidget *widget);
void handleSemanticTokens(const LanguageServerProtocol::SemanticTokens &tokens);
void rehighlight();
using ContentHandler = std::function<void(const QByteArray &, QTextCodec *, QString &,
@@ -244,6 +249,7 @@ private:
SymbolSupport m_symbolSupport;
ProgressManager m_progressManager;
bool m_activateDocAutomatically = false;
SemanticTokenSupport m_tokentSupport;
};
} // namespace LanguageClient