From c65e480cbd9511b0641d9fdc46c86694767b3a87 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 18 Jul 2019 10:52:27 +0200 Subject: [PATCH] LanguageClient: include the range length in document updates The did change notification parameter has an arguable redundant range length field, but it seems that there are language server out there which rely on the presence of this field. Change-Id: Id29132fb6586a2886b8ba6d9a13df52a64f31161 Fixes: QTCREATORBUG-22694 Reviewed-by: Eike Ziller --- src/plugins/languageclient/client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index dba6f93cc22..f53d4dd9dc9 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -469,6 +469,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document, cursor.setPosition(position + charsRemoved); cursor.setPosition(position, QTextCursor::KeepAnchor); change.setRange(Range(cursor)); + change.setRangeLength(cursor.selectionEnd() - cursor.selectionStart()); change.setText(document->textAt(position, charsAdded)); params.setContentChanges({change}); } else {