@@ -25,10 +25,16 @@ import { withNullAsUndefined } from 'vs/base/common/types';
2525export type ServicesAccessor = InstantiationServicesAccessor ;
2626export type IEditorContributionCtor = IConstructorSignature1 < ICodeEditor , IEditorContribution > ;
2727export type IDiffEditorContributionCtor = IConstructorSignature1 < IDiffEditor , IDiffEditorContribution > ;
28- export type EditorTelemetryDataFragment = {
29- target : { classification : 'SystemMetaData' , purpose : 'FeatureInsight' , } ;
30- snippet : { classification : 'SystemMetaData' , purpose : 'FeatureInsight' , isMeasurement : true , } ;
31- } ;
28+
29+ export interface IEditorContributionDescription {
30+ id : string ;
31+ ctor : IEditorContributionCtor ;
32+ }
33+
34+ export interface IDiffEditorContributionDescription {
35+ id : string ;
36+ ctor : IDiffEditorContributionCtor ;
37+ }
3238
3339//#region Command
3440
@@ -297,12 +303,12 @@ export function registerInstantiatedEditorAction(editorAction: EditorAction): vo
297303 EditorContributionRegistry . INSTANCE . registerEditorAction ( editorAction ) ;
298304}
299305
300- export function registerEditorContribution ( ctor : IEditorContributionCtor ) : void {
301- EditorContributionRegistry . INSTANCE . registerEditorContribution ( ctor ) ;
306+ export function registerEditorContribution ( id : string , ctor : IEditorContributionCtor ) : void {
307+ EditorContributionRegistry . INSTANCE . registerEditorContribution ( id , ctor ) ;
302308}
303309
304- export function registerDiffEditorContribution ( ctor : IDiffEditorContributionCtor ) : void {
305- EditorContributionRegistry . INSTANCE . registerDiffEditorContribution ( ctor ) ;
310+ export function registerDiffEditorContribution ( id : string , ctor : IDiffEditorContributionCtor ) : void {
311+ EditorContributionRegistry . INSTANCE . registerDiffEditorContribution ( id , ctor ) ;
306312}
307313
308314export namespace EditorExtensionsRegistry {
@@ -315,11 +321,11 @@ export namespace EditorExtensionsRegistry {
315321 return EditorContributionRegistry . INSTANCE . getEditorActions ( ) ;
316322 }
317323
318- export function getEditorContributions ( ) : IEditorContributionCtor [ ] {
324+ export function getEditorContributions ( ) : IEditorContributionDescription [ ] {
319325 return EditorContributionRegistry . INSTANCE . getEditorContributions ( ) ;
320326 }
321327
322- export function getDiffEditorContributions ( ) : IDiffEditorContributionCtor [ ] {
328+ export function getDiffEditorContributions ( ) : IDiffEditorContributionDescription [ ] {
323329 return EditorContributionRegistry . INSTANCE . getDiffEditorContributions ( ) ;
324330 }
325331}
@@ -333,8 +339,8 @@ class EditorContributionRegistry {
333339
334340 public static readonly INSTANCE = new EditorContributionRegistry ( ) ;
335341
336- private readonly editorContributions : IEditorContributionCtor [ ] ;
337- private readonly diffEditorContributions : IDiffEditorContributionCtor [ ] ;
342+ private readonly editorContributions : IEditorContributionDescription [ ] ;
343+ private readonly diffEditorContributions : IDiffEditorContributionDescription [ ] ;
338344 private readonly editorActions : EditorAction [ ] ;
339345 private readonly editorCommands : { [ commandId : string ] : EditorCommand ; } ;
340346
@@ -345,19 +351,19 @@ class EditorContributionRegistry {
345351 this . editorCommands = Object . create ( null ) ;
346352 }
347353
348- public registerEditorContribution ( ctor : IEditorContributionCtor ) : void {
349- this . editorContributions . push ( ctor ) ;
354+ public registerEditorContribution ( id : string , ctor : IEditorContributionCtor ) : void {
355+ this . editorContributions . push ( { id , ctor } ) ;
350356 }
351357
352- public getEditorContributions ( ) : IEditorContributionCtor [ ] {
358+ public getEditorContributions ( ) : IEditorContributionDescription [ ] {
353359 return this . editorContributions . slice ( 0 ) ;
354360 }
355361
356- public registerDiffEditorContribution ( ctor : IDiffEditorContributionCtor ) : void {
357- this . diffEditorContributions . push ( ctor ) ;
362+ public registerDiffEditorContribution ( id : string , ctor : IDiffEditorContributionCtor ) : void {
363+ this . diffEditorContributions . push ( { id , ctor } ) ;
358364 }
359365
360- public getDiffEditorContributions ( ) : IDiffEditorContributionCtor [ ] {
366+ public getDiffEditorContributions ( ) : IDiffEditorContributionDescription [ ] {
361367 return this . diffEditorContributions . slice ( 0 ) ;
362368 }
363369
0 commit comments