forked from qt-creator/qt-creator
LanguageClient: cancel find link at requests on rerequest
This avoids triggering the callback if we already requested a find link at for a different position. Additionally we also cancel the request if the document changes or the cursor moves inbetween requesting the link and receiving the response. Change-Id: Iffc7b08012a649397e7ca7dfc99d314a1bbf19f7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -463,7 +463,7 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
|
||||
[document = textEditor->textDocument()]
|
||||
(const QTextCursor &cursor, const Utils::LinkHandler &callback, bool resolveTarget) {
|
||||
if (auto client = clientForDocument(document))
|
||||
client->symbolSupport().findLinkAt(document, cursor, callback, resolveTarget);
|
||||
client->findLinkAt(document, cursor, callback, resolveTarget);
|
||||
});
|
||||
connect(widget, &TextEditorWidget::requestUsages, this,
|
||||
[document = textEditor->textDocument()](const QTextCursor &cursor) {
|
||||
|
||||
Reference in New Issue
Block a user