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 <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2019-07-18 10:52:27 +02:00
parent 53ca9752e2
commit c65e480cbd

View File

@@ -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 {