77import { illegalArgument } from 'vs/base/common/errors' ;
88import URI from 'vs/base/common/uri' ;
99import { TPromise } from 'vs/base/common/winjs.base' ;
10- import { ServicesAccessor , IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
10+ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
1111import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
1212import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
1313import { Registry } from 'vs/platform/platform' ;
@@ -112,7 +112,7 @@ export module CommonEditorRegistry {
112112
113113 // --- Editor Contributions
114114
115- export function getEditorContributions ( ) : editorCommon . ICommonEditorContributionDescriptor [ ] {
115+ export function getEditorContributions ( ) : editorCommon . ICommonEditorContributionCtor [ ] {
116116 return EditorContributionRegistry . INSTANCE . getEditorContributions ( ) ;
117117 }
118118
@@ -150,28 +150,16 @@ export module CommonEditorRegistry {
150150 }
151151}
152152
153- class SimpleEditorContributionDescriptor implements editorCommon . ICommonEditorContributionDescriptor {
154- private _ctor :editorCommon . ICommonEditorContributionCtor ;
155-
156- constructor ( ctor :editorCommon . ICommonEditorContributionCtor ) {
157- this . _ctor = ctor ;
158- }
159-
160- public createInstance ( instantiationService : IInstantiationService , editor :editorCommon . ICommonCodeEditor ) : editorCommon . IEditorContribution {
161- return instantiationService . createInstance ( this . _ctor , editor ) ;
162- }
163- }
164-
165153// Editor extension points
166- var Extensions = {
154+ const Extensions = {
167155 EditorCommonContributions : 'editor.commonContributions'
168156} ;
169157
170158class EditorContributionRegistry {
171159
172160 public static INSTANCE = new EditorContributionRegistry ( ) ;
173161
174- private editorContributions : editorCommon . ICommonEditorContributionDescriptor [ ] ;
162+ private editorContributions : editorCommon . ICommonEditorContributionCtor [ ] ;
175163 private editorActions : EditorAction [ ] ;
176164
177165 constructor ( ) {
@@ -180,7 +168,7 @@ class EditorContributionRegistry {
180168 }
181169
182170 public registerEditorContribution ( ctor :editorCommon . ICommonEditorContributionCtor ) : void {
183- this . editorContributions . push ( new SimpleEditorContributionDescriptor ( ctor ) ) ;
171+ this . editorContributions . push ( ctor ) ;
184172 }
185173
186174 public registerEditorAction ( action :EditorAction ) {
@@ -195,7 +183,7 @@ class EditorContributionRegistry {
195183 this . editorActions . push ( action ) ;
196184 }
197185
198- public getEditorContributions ( ) : editorCommon . ICommonEditorContributionDescriptor [ ] {
186+ public getEditorContributions ( ) : editorCommon . ICommonEditorContributionCtor [ ] {
199187 return this . editorContributions . slice ( 0 ) ;
200188 }
201189
0 commit comments