mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Adds timeline diff on click and icon support
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user