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,22 +205,20 @@ void LanguageClientManager::editorOpened(Core::IEditor *iEditor)
|
||||
for (Client *interface : reachableClients())
|
||||
interface->openDocument(document);
|
||||
|
||||
if (auto textDocument = qobject_cast<TextDocument *>(document)) {
|
||||
if (BaseTextEditor *editor = BaseTextEditor::textEditorForDocument(textDocument)) {
|
||||
if (BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(iEditor)) {
|
||||
if (TextEditorWidget *widget = editor->editorWidget()) {
|
||||
connect(widget, &TextEditorWidget::requestLinkAt, this,
|
||||
[this, filePath = document->filePath()]
|
||||
(const QTextCursor &cursor, Utils::ProcessLinkCallback &callback){
|
||||
(const QTextCursor &cursor, Utils::ProcessLinkCallback &callback) {
|
||||
findLinkAt(filePath, cursor, callback);
|
||||
});
|
||||
connect(widget, &TextEditorWidget::requestUsages, this,
|
||||
[this, filePath = document->filePath()]
|
||||
(const QTextCursor &cursor){
|
||||
(const QTextCursor &cursor) {
|
||||
findUsages(filePath, cursor);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LanguageClientManager::editorsClosed(const QList<Core::IEditor *> &editors)
|
||||
|
||||
Reference in New Issue
Block a user