forked from qt-creator/qt-creator
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:
@@ -469,6 +469,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document,
|
|||||||
cursor.setPosition(position + charsRemoved);
|
cursor.setPosition(position + charsRemoved);
|
||||||
cursor.setPosition(position, QTextCursor::KeepAnchor);
|
cursor.setPosition(position, QTextCursor::KeepAnchor);
|
||||||
change.setRange(Range(cursor));
|
change.setRange(Range(cursor));
|
||||||
|
change.setRangeLength(cursor.selectionEnd() - cursor.selectionStart());
|
||||||
change.setText(document->textAt(position, charsAdded));
|
change.setText(document->textAt(position, charsAdded));
|
||||||
params.setContentChanges({change});
|
params.setContentChanges({change});
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user