Adds timeline diff on click and icon support

This commit is contained in:
Eric Amodio
2020-01-17 17:19:52 -05:00
committed by Eric Amodio
parent 70e1e9b4f4
commit 87c2332fed
17 changed files with 424 additions and 248 deletions

View File

@@ -5,13 +5,12 @@
import { MainContext, MainThreadTimelineShape, IExtHostContext, ExtHostTimelineShape, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ITimelineService, TimelineItem } from 'vs/workbench/contrib/timeline/common/timeline';
import { ITimelineService, TimelineItem, TimelineProviderDescriptor } from 'vs/workbench/contrib/timeline/common/timeline';
import { URI } from 'vs/base/common/uri';
import { CancellationToken } from 'vs/base/common/cancellation';
@extHostNamedCustomer(MainContext.MainThreadTimeline)
export class MainThreadTimeline implements MainThreadTimelineShape {
private readonly _proxy: ExtHostTimelineShape;
constructor(
@@ -25,21 +24,23 @@ export class MainThreadTimeline implements MainThreadTimelineShape {
return this._timelineService.getTimeline(uri, since, token);
}
$registerTimelineProvider(key: string, id: string): void {
console.log(`MainThreadTimeline#registerTimelineProvider: key=${key}`);
$registerTimelineProvider(provider: TimelineProviderDescriptor): void {
console.log(`MainThreadTimeline#registerTimelineProvider: provider=${provider.source}`);
const proxy = this._proxy;
this._timelineService.registerTimelineProvider(key, {
id: id,
this._timelineService.registerTimelineProvider({
...provider,
provideTimeline(uri: URI, since: number, token: CancellationToken) {
return proxy.$getTimeline(key, uri, since, token);
}
return proxy.$getTimeline(provider.source, uri, since, token);
},
dispose() { }
});
}
$unregisterTimelineProvider(key: string): void {
console.log(`MainThreadTimeline#unregisterTimelineProvider: key=${key}`);
this._timelineService.unregisterTimelineProvider(key);
$unregisterTimelineProvider(source: string): void {
console.log(`MainThreadTimeline#unregisterTimelineProvider: source=${source}`);
this._timelineService.unregisterTimelineProvider(source);
}
dispose(): void {