LanguageClient: add support for proposed semantic highlight

implements the current proposal for the semantic highlighting
via the language server protocol.
https://github.com/microsoft/vscode-languageserver-node/pull/367

Change-Id: I857d606fcf5c782e0ea8e18e5d098edd26286aed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2019-06-12 12:55:06 +02:00
parent b6a9f0245b
commit 307f1d8e6e
19 changed files with 515 additions and 27 deletions

View File

@@ -45,6 +45,8 @@
#include <languageserverprotocol/shutdownmessages.h>
#include <languageserverprotocol/textsynchronization.h>
#include <texteditor/semantichighlighter.h>
#include <QBuffer>
#include <QHash>
#include <QProcess>
@@ -158,6 +160,7 @@ public:
const BaseClientInterface *clientInterface() const;
DocumentSymbolCache *documentSymbolCache();
HoverHandler *hoverHandler();
void rehighlight();
signals:
void initialized(LanguageServerProtocol::ServerCapabilities capabilities);
@@ -174,6 +177,7 @@ private:
const LanguageServerProtocol::IContent *content);
void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams &params);
void handleSemanticHighlight(const LanguageServerProtocol::SemanticHighlightingParams &params);
void intializeCallback(const LanguageServerProtocol::InitializeRequest::Response &initResponse);
void shutDownCallback(const LanguageServerProtocol::ShutdownRequest::Response &shutdownResponse);
@@ -210,6 +214,7 @@ private:
QMap<LanguageServerProtocol::DocumentUri, QList<TextMark *>> m_diagnostics;
DocumentSymbolCache m_documentSymbolCache;
HoverHandler m_hoverHandler;
QHash<LanguageServerProtocol::DocumentUri, TextEditor::HighlightingResults> m_highlights;
const ProjectExplorer::Project *m_project = nullptr;
};