LSP: add rename functionality

Fixes: QTCREATORBUG-21578
Change-Id: Iec54ebed6358453af4ef16a2a4e6aef0418faebe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-05-11 08:41:57 +02:00
parent 5f91985931
commit 2b36770d07
8 changed files with 269 additions and 16 deletions

View File

@@ -415,6 +415,11 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
if (auto client = clientForDocument(document))
client->symbolSupport().findUsages(document, cursor);
});
connect(widget, &TextEditorWidget::requestRename, this,
[document = textEditor->textDocument()](const QTextCursor &cursor) {
if (auto client = clientForDocument(document))
client->symbolSupport().renameSymbol(document, cursor);
});
connect(widget, &TextEditorWidget::cursorPositionChanged, this, [this, widget]() {
// TODO This would better be a compressing timer
QTimer::singleShot(50, this, [widget = QPointer<TextEditorWidget>(widget)]() {