diff --git a/extensions/git/src/timelineProvider.ts b/extensions/git/src/timelineProvider.ts index f2701c4be01..d6e2be8613b 100644 --- a/extensions/git/src/timelineProvider.ts +++ b/extensions/git/src/timelineProvider.ts @@ -227,6 +227,6 @@ export class GitTimelineProvider implements TimelineProvider { @debounce(500) private fireChanged() { - this._onDidChange.fire({ reset: true }); + this._onDidChange.fire(undefined); } } diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 12dce38ecc6..713811c91b3 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1890,9 +1890,8 @@ declare module 'vscode' { export interface TimelineChangeEvent { /** * The [uri](#Uri) of the resource for which the timeline changed. - * If the [uri](#Uri) is `undefined` that signals that the timeline source for all resources changed. */ - uri?: Uri; + uri: Uri; /** * A flag which indicates whether the entire timeline should be reset. @@ -1933,7 +1932,7 @@ declare module 'vscode' { * An optional event to signal that the timeline for a source has changed. * To signal that the timeline for all resources (uris) has changed, do not pass any argument or pass `undefined`. */ - onDidChange?: Event; + onDidChange?: Event; /** * An identifier of the source of the timeline items. This can be used to filter sources. diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 1aa6d171ff2..55981239258 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -885,7 +885,7 @@ export interface MainThreadTunnelServiceShape extends IDisposable { export interface MainThreadTimelineShape extends IDisposable { $registerTimelineProvider(provider: TimelineProviderDescriptor): void; $unregisterTimelineProvider(source: string): void; - $emitTimelineChangeEvent(e: TimelineChangeEvent): void; + $emitTimelineChangeEvent(e: TimelineChangeEvent | undefined): void; } // -- extension host diff --git a/src/vs/workbench/api/common/extHostTimeline.ts b/src/vs/workbench/api/common/extHostTimeline.ts index 4df94da98d5..c15a9e73617 100644 --- a/src/vs/workbench/api/common/extHostTimeline.ts +++ b/src/vs/workbench/api/common/extHostTimeline.ts @@ -60,7 +60,7 @@ export class ExtHostTimeline implements IExtHostTimeline { let disposable: IDisposable | undefined; if (provider.onDidChange) { - disposable = provider.onDidChange(e => this._proxy.$emitTimelineChangeEvent({ ...e, id: provider.id }), this); + disposable = provider.onDidChange(e => this._proxy.$emitTimelineChangeEvent({ uri: undefined, reset: true, ...e, id: provider.id }), this); } const itemsBySourceAndUriMap = this._itemsBySourceAndUriMap; diff --git a/src/vs/workbench/contrib/timeline/browser/timelinePane.ts b/src/vs/workbench/contrib/timeline/browser/timelinePane.ts index 5c4307dfbb1..ae8eca65ff6 100644 --- a/src/vs/workbench/contrib/timeline/browser/timelinePane.ts +++ b/src/vs/workbench/contrib/timeline/browser/timelinePane.ts @@ -359,9 +359,9 @@ export class TimelinePane extends ViewPane { } if (this.isBodyVisible()) { - this.updateTimeline(timeline, e.reset ?? false); + this.updateTimeline(timeline, e.reset); } else { - timeline.invalidate(e.reset ?? false); + timeline.invalidate(e.reset); } } } diff --git a/src/vs/workbench/contrib/timeline/common/timeline.ts b/src/vs/workbench/contrib/timeline/common/timeline.ts index 84877649f50..c84c77e41f9 100644 --- a/src/vs/workbench/contrib/timeline/common/timeline.ts +++ b/src/vs/workbench/contrib/timeline/common/timeline.ts @@ -38,8 +38,8 @@ export interface TimelineItem { export interface TimelineChangeEvent { id: string; - uri?: URI; - reset?: boolean + uri: URI | undefined; + reset: boolean } export interface TimelineOptions {