This commit is contained in:
Eric Amodio
2020-04-06 23:58:04 -04:00
parent 8b8a8ed724
commit 4ccf3e4ef3
6 changed files with 9 additions and 10 deletions

View File

@@ -227,6 +227,6 @@ export class GitTimelineProvider implements TimelineProvider {
@debounce(500)
private fireChanged() {
this._onDidChange.fire({ reset: true });
this._onDidChange.fire(undefined);
}
}

View File

@@ -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<TimelineChangeEvent>;
onDidChange?: Event<TimelineChangeEvent | undefined>;
/**
* An identifier of the source of the timeline items. This can be used to filter sources.

View File

@@ -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

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -38,8 +38,8 @@ export interface TimelineItem {
export interface TimelineChangeEvent {
id: string;
uri?: URI;
reset?: boolean
uri: URI | undefined;
reset: boolean
}
export interface TimelineOptions {