forked from qt-creator/qt-creator
LSP: add rename functionality
Fixes: QTCREATORBUG-21578 Change-Id: Iec54ebed6358453af4ef16a2a4e6aef0418faebe Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
|
||||
#include <languageserverprotocol/languagefeatures.h>
|
||||
|
||||
namespace Core {
|
||||
class SearchResult;
|
||||
class SearchResultItem;
|
||||
}
|
||||
|
||||
namespace LanguageClient {
|
||||
|
||||
class Client;
|
||||
@@ -45,11 +50,24 @@ public:
|
||||
const bool resolveTarget);
|
||||
void findUsages(TextEditor::TextDocument *document, const QTextCursor &cursor);
|
||||
|
||||
bool supportsRename(TextEditor::TextDocument *document);
|
||||
void renameSymbol(TextEditor::TextDocument *document, const QTextCursor &cursor);
|
||||
|
||||
private:
|
||||
void handleFindReferencesResponse(
|
||||
const LanguageServerProtocol::FindReferencesRequest::Response &response,
|
||||
const QString &wordUnderCursor);
|
||||
|
||||
void requestPrepareRename(const LanguageServerProtocol::TextDocumentPositionParams ¶ms,
|
||||
const QString &placeholder);
|
||||
void requestRename(const LanguageServerProtocol::TextDocumentPositionParams &positionParams,
|
||||
const QString &newName, Core::SearchResult *search);
|
||||
void startRenameSymbol(const LanguageServerProtocol::TextDocumentPositionParams ¶ms,
|
||||
const QString &placeholder);
|
||||
void handleRenameResponse(Core::SearchResult *search,
|
||||
const LanguageServerProtocol::RenameRequest::Response &response);
|
||||
void applyRename(const QList<Core::SearchResultItem> &checkedItems);
|
||||
|
||||
Client *m_client = nullptr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user