TextEditor: return all BaseTextEditor for a document

Change-Id: Iab483528357fdba1b7107130c19370974c03979c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2019-03-12 13:46:31 +01:00
parent a1973090da
commit 6b59d711a8
5 changed files with 24 additions and 21 deletions

View File

@@ -133,12 +133,10 @@ void updateCodeActionRefactoringMarker(Client *client,
TextDocument* doc = TextDocument::textDocumentForFileName(uri.toFileName());
if (!doc)
return;
BaseTextEditor *editor = BaseTextEditor::textEditorForDocument(doc);
if (!editor)
const QVector<BaseTextEditor *> editors = BaseTextEditor::textEditorsForDocument(doc);
if (editors.isEmpty())
return;
TextEditorWidget *editorWidget = editor->editorWidget();
const QList<Diagnostic> &diagnostics = action.diagnostics().value_or(QList<Diagnostic>());
RefactorMarkers markers;
@@ -181,7 +179,10 @@ void updateCodeActionRefactoringMarker(Client *client,
marker.cursor = endOfLineCursor(diagnostic.range().start().toTextCursor(doc->document()));
markers << marker;
}
editorWidget->setRefactorMarkers(markers + editorWidget->refactorMarkers());
for (BaseTextEditor *editor : editors) {
if (TextEditorWidget *editorWidget = editor->editorWidget())
editorWidget->setRefactorMarkers(markers + editorWidget->refactorMarkers());
}
}
} // namespace LanguageClient