forked from qt-creator/qt-creator
TextEditor: return all BaseTextEditor for a document
Change-Id: Iab483528357fdba1b7107130c19370974c03979c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user