@@ -18,19 +18,18 @@ import {CommonEditorConfiguration} from 'vs/editor/common/config/commonEditorCon
1818import { Range } from 'vs/editor/common/core/range' ;
1919import { Selection } from 'vs/editor/common/core/selection' ;
2020import * as editorCommon from 'vs/editor/common/editorCommon' ;
21- import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions' ;
21+ import { EditorAction } from 'vs/editor/common/editorCommonExtensions' ;
2222import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService' ;
2323import { Configuration } from 'vs/editor/browser/config/configuration' ;
2424import * as editorBrowser from 'vs/editor/browser/editorBrowser' ;
25- import { EditorBrowserRegistry } from 'vs/editor/browser/editorBrowserExtensions' ;
2625import { Colorizer } from 'vs/editor/browser/standalone/colorizer' ;
2726import { View } from 'vs/editor/browser/view/viewImpl' ;
2827import { Disposable , IDisposable } from 'vs/base/common/lifecycle' ;
2928import Event , { Emitter } from 'vs/base/common/event' ;
3029import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent' ;
3130import { InternalEditorAction } from 'vs/editor/common/editorAction' ;
3231
33- export class CodeEditorWidget extends CommonCodeEditor implements editorBrowser . ICodeEditor {
32+ export abstract class CodeEditorWidget extends CommonCodeEditor implements editorBrowser . ICodeEditor {
3433
3534 public onMouseUp ( listener : ( e :editorBrowser . IEditorMouseEvent ) => void ) : IDisposable {
3635 return this . addListener2 ( editorCommon . EventType . MouseUp , listener ) ;
@@ -99,7 +98,7 @@ export class CodeEditorWidget extends CommonCodeEditor implements editorBrowser.
9998 this . contentWidgets = { } ;
10099 this . overlayWidgets = { } ;
101100
102- let contributionDescriptors = [ ] . concat ( EditorBrowserRegistry . getEditorContributions ( ) ) . concat ( CommonEditorRegistry . getEditorContributions ( ) ) ;
101+ let contributionDescriptors = this . _getContributions ( ) ;
103102 for ( let i = 0 , len = contributionDescriptors . length ; i < len ; i ++ ) {
104103 try {
105104 let contribution = contributionDescriptors [ i ] . createInstance ( this . _instantiationService , this ) ;
@@ -109,14 +108,17 @@ export class CodeEditorWidget extends CommonCodeEditor implements editorBrowser.
109108 }
110109 }
111110
112- CommonEditorRegistry . getEditorActions ( ) . forEach ( ( action ) => {
111+ this . _getActions ( ) . forEach ( ( action ) => {
113112 let internalAction = new InternalEditorAction ( action , this , this . _instantiationService , this . _contextKeyService ) ;
114113 this . _actions [ internalAction . id ] = internalAction ;
115114 } ) ;
116115
117116 this . _codeEditorService . addCodeEditor ( this ) ;
118117 }
119118
119+ protected abstract _getContributions ( ) : editorBrowser . IEditorContributionDescriptor [ ] ;
120+ protected abstract _getActions ( ) : EditorAction [ ] ;
121+
120122 protected _createConfiguration ( options :editorCommon . ICodeEditorWidgetCreationOptions ) : CommonEditorConfiguration {
121123 return new Configuration ( options , this . domElement ) ;
122124 }
0 commit comments