LanguageClient: send partial document in update notification

Reduce the amount of transferred data between client and server by
sending events which just contain the changed part of the document
instead of the full content if the server supports those events.

Change-Id: I596930c405bd7a71e4219e328b449fca67664750
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-04-02 10:49:23 +02:00
parent 2f505fd0f9
commit 763f114c83
3 changed files with 36 additions and 12 deletions

View File

@@ -96,7 +96,10 @@ public:
bool documentOpen(const Core::IDocument *document) const;
void documentContentsSaved(Core::IDocument *document);
void documentWillSave(Core::IDocument *document);
void documentContentsChanged(Core::IDocument *document);
void documentContentsChanged(TextEditor::TextDocument *document,
int position,
int charsRemoved,
int charsAdded);
void registerCapabilities(const QList<LanguageServerProtocol::Registration> &registrations);
void unregisterCapabilities(const QList<LanguageServerProtocol::Unregistration> &unregistrations);
bool findLinkAt(LanguageServerProtocol::GotoDefinitionRequest &request);
@@ -190,7 +193,7 @@ private:
QHash<QByteArray, ContentHandler> m_contentHandler;
QString m_displayName;
LanguageFilter m_languagFilter;
QList<Utils::FileName> m_openedDocument;
QMap<Utils::FileName, QString> m_openedDocument;
Core::Id m_id;
LanguageServerProtocol::ServerCapabilities m_serverCapabilities;
DynamicCapabilities m_dynamicCapabilities;