forked from qt-creator/qt-creator
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:
@@ -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 ¶ms);
|
||||
void handleSemanticHighlight(const LanguageServerProtocol::SemanticHighlightingParams ¶ms);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user