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:
David Schulz
2019-03-12 13:04:41 +01:00
parent bbbf727272
commit a78bbe48cc

View File

@@ -205,8 +205,7 @@ 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()]
@@ -221,7 +220,6 @@ void LanguageClientManager::editorOpened(Core::IEditor *iEditor)
}
}
}
}
void LanguageClientManager::editorsClosed(const QList<Core::IEditor *> &editors)
{