Change:
We have a "collapse all" button: And other places in vscode this typically toggles to an "expand all". Would make sense to have it here as well
PR is now available for review

Discussion:
}); } <ins> public expandAll(): void { transaction(tx => { for (const d of this.items.get()) { d.collapsed.set(false, tx); } }); } </ins> constructor( private readonly _model: IMultiDiffEditorModel, private readonly _instantiationService: IInstantiationService,

this._contextKeyService.createKey(EditorContextKeys.inMultiDiffEditor.key, true); <ins> const ctxAllCollapsed = this._parentContextKeyService.createKey<boolean>(EditorContextKeys.multiDiffEditorAllCollapsed.key, false); this._register(autorun((reader) => { const viewModel = this._viewModel.read(reader); if (viewModel) { const allCollapsed = viewModel.items.read(reader).every(item => item.collapsed.read(reader)); ctxAllCollapsed.set(allCollapsed); } })); </ins> this._register(autorun((reader) => { const lastActiveDiffItem = this.lastActiveDiffItem.read(reader); transaction(tx => {

export const inDiffEditor = new RawContextKey<boolean>('inDiffEditor', false, nls.localize('inDiffEditor', "Whether the context is a diff editor")); export const isEmbeddedDiffEditor = new RawContextKey<boolean>('isEmbeddedDiffEditor', false, nls.localize('isEmbeddedDiffEditor', "Whether the context is an embedded diff editor")); export const inMultiDiffEditor = new RawContextKey<boolean>('inMultiDiffEditor', false, nls.localize('inMultiDiffEditor', "Whether the context is a multi diff editor")); <ins> export const multiDiffEditorAllCollapsed = new RawContextKey<boolean>('multiDiffEditorAllCollapsed', undefined, nls.localize('multiDiffEditorAllCollapsed', "Whether all files in multi diff editor are collapsed")); </ins> export const hasChanges = new RawContextKey<boolean>('diffEditorHasChanges', false, nls.localize('diffEditorHasChanges', "Whether the diff editor has changes")); export const comparingMovedCode = new RawContextKey<boolean>('comparingMovedCode', false, nls.localize('comparingMovedCode', "Whether a moved code block is selected for comparison"));

id: 'multiDiffEditor.collapseAll', title: { value: localize('collapseAllDiffs', "Collapse All Diffs"), original: 'Collapse All Diffs' }, icon: Codicon.collapseAll, <del> precondition: ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID), </del> <ins> precondition: ContextKeyExpr.and(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID), ContextKeyExpr.not('multiDiffEditorAllCollapsed')), </ins> menu: { <del> when: ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID), </del> <ins> when: ContextKeyExpr.and(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID), ContextKeyExpr.not('multiDiffEditorAllCollapsed')), </ins> id: MenuId.EditorTitle, group: 'navigation', },

} } <ins> export class ExpandAllAction extends Action2 { constructor() { super({ id: 'multiDiffEditor.expandAll', title: { value: localize('ExpandAllDiffs', "Expand All Diffs"), original: 'Expand All Diffs' }, icon: Codicon.expandAll, precondition: ContextKeyExpr.and(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID), ContextKeyExpr.has('multiDiffEditorAllCollapsed')), menu: { when: ContextKeyExpr.and(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID), ContextKeyExpr.has('multiDiffEditorAllCollapsed')), id: MenuId.EditorTitle, group: 'navigation', }, f1: true, }); } async run(accessor: ServicesAccessor, ...args: any[]): Promise<void> { const editorService = accessor.get(IEditorService); const activeEditor = editorService.activeEditor; if (activeEditor instanceof MultiDiffEditorInput) { const viewModel = await activeEditor.getViewModel(); viewModel.expandAll(); } } } </ins> registerAction2(GoToFileAction); registerAction2(CollapseAllAction); <ins> registerAction2(ExpandAllAction); </ins> Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({ properties: {