forked from qt-creator/qt-creator
LanguageClient: connect the opened editor to LanguageClientManager
... and not just the first one returned by BaseTextEditor::textEditorForDocument Change-Id: I39e9271b3a2b6c0f131a5ce77959a8d57e462397 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -205,20 +205,18 @@ void LanguageClientManager::editorOpened(Core::IEditor *iEditor)
|
|||||||
for (Client *interface : reachableClients())
|
for (Client *interface : reachableClients())
|
||||||
interface->openDocument(document);
|
interface->openDocument(document);
|
||||||
|
|
||||||
if (auto textDocument = qobject_cast<TextDocument *>(document)) {
|
if (BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(iEditor)) {
|
||||||
if (BaseTextEditor *editor = BaseTextEditor::textEditorForDocument(textDocument)) {
|
if (TextEditorWidget *widget = editor->editorWidget()) {
|
||||||
if (TextEditorWidget *widget = editor->editorWidget()) {
|
connect(widget, &TextEditorWidget::requestLinkAt, this,
|
||||||
connect(widget, &TextEditorWidget::requestLinkAt, this,
|
[this, filePath = document->filePath()]
|
||||||
[this, filePath = document->filePath()]
|
(const QTextCursor &cursor, Utils::ProcessLinkCallback &callback) {
|
||||||
(const QTextCursor &cursor, Utils::ProcessLinkCallback &callback){
|
findLinkAt(filePath, cursor, callback);
|
||||||
findLinkAt(filePath, cursor, callback);
|
});
|
||||||
});
|
connect(widget, &TextEditorWidget::requestUsages, this,
|
||||||
connect(widget, &TextEditorWidget::requestUsages, this,
|
[this, filePath = document->filePath()]
|
||||||
[this, filePath = document->filePath()]
|
(const QTextCursor &cursor) {
|
||||||
(const QTextCursor &cursor){
|
findUsages(filePath, cursor);
|
||||||
findUsages(filePath, cursor);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user