forked from qt-creator/qt-creator
LanguageClient: Allow for custom symbol search result handling
Change-Id: If19ce24b39820afbfd48c48493e07709f4b3633e Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "languageclient_global.h"
|
||||
|
||||
#include <coreplugin/find/searchresultitem.h>
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
#include <languageserverprotocol/languagefeatures.h>
|
||||
@@ -36,6 +37,8 @@ class SearchResult;
|
||||
class SearchResultItem;
|
||||
}
|
||||
|
||||
namespace LanguageServerProtocol { class MessageId; }
|
||||
|
||||
namespace LanguageClient {
|
||||
|
||||
class Client;
|
||||
@@ -50,15 +53,24 @@ public:
|
||||
const QTextCursor &cursor,
|
||||
Utils::ProcessLinkCallback callback,
|
||||
const bool resolveTarget);
|
||||
void findUsages(TextEditor::TextDocument *document, const QTextCursor &cursor);
|
||||
|
||||
using ResultHandler = std::function<void(const QList<LanguageServerProtocol::Location> &)>;
|
||||
Utils::optional<LanguageServerProtocol::MessageId> findUsages(
|
||||
TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
const ResultHandler &handler = {});
|
||||
|
||||
bool supportsRename(TextEditor::TextDocument *document);
|
||||
void renameSymbol(TextEditor::TextDocument *document, const QTextCursor &cursor);
|
||||
|
||||
static Core::Search::TextRange convertRange(const LanguageServerProtocol::Range &range);
|
||||
static QStringList getFileContents(const QString &filePath);
|
||||
|
||||
private:
|
||||
void handleFindReferencesResponse(
|
||||
const LanguageServerProtocol::FindReferencesRequest::Response &response,
|
||||
const QString &wordUnderCursor);
|
||||
const QString &wordUnderCursor,
|
||||
const ResultHandler &handler);
|
||||
|
||||
void requestPrepareRename(const LanguageServerProtocol::TextDocumentPositionParams ¶ms,
|
||||
const QString &placeholder);
|
||||
|
||||
Reference in New Issue
Block a user