@@ -143,17 +143,16 @@ export class GoToTypeDeclarationActions extends GoToTypeAction {
143143 }
144144}
145145
146- export class GoToDeclarationAction extends GoToTypeAction {
147-
148- public static ID = 'editor.action.goToDeclaration' ;
146+ export abstract class BaseGoToDeclarationAction extends GoToTypeAction {
149147
150148 constructor (
151149 descriptor : editorCommon . IEditorActionDescriptorData ,
152150 editor : editorCommon . ICommonCodeEditor ,
153- @IMessageService messageService : IMessageService ,
154- @IEditorService editorService : IEditorService
151+ messageService : IMessageService ,
152+ editorService : IEditorService ,
153+ condition : Behaviour
155154 ) {
156- super ( descriptor , editor , messageService , editorService , this . behaviour ) ;
155+ super ( descriptor , editor , messageService , editorService , condition ) ;
157156 }
158157
159158 public getGroupId ( ) : string {
@@ -179,38 +178,45 @@ export class GoToDeclarationAction extends GoToTypeAction {
179178 } ) ;
180179 }
181180
182- protected get behaviour ( ) : Behaviour {
183- return DEFAULT_BEHAVIOR ;
184- }
185181
186182 protected _resolve ( resource : URI , position : editorCommon . IPosition ) : TPromise < IReference [ ] > {
187183 return getDeclarationsAtPosition ( this . editor . getModel ( ) , this . editor . getPosition ( ) ) ;
188184 }
189185}
190186
191- export class OpenDeclarationToTheSideAction extends GoToDeclarationAction {
187+ export class GoToDeclarationAction extends BaseGoToDeclarationAction {
192188
193- public static ID = 'editor.action.openDeclarationToTheSide ' ;
189+ public static ID = 'editor.action.goToDeclaration ' ;
194190
195191 constructor (
196192 descriptor : editorCommon . IEditorActionDescriptorData ,
197193 editor : editorCommon . ICommonCodeEditor ,
198194 @IMessageService messageService : IMessageService ,
199195 @IEditorService editorService : IEditorService
200196 ) {
201- super ( descriptor , editor , messageService , editorService ) ;
197+ super ( descriptor , editor , messageService , editorService , DEFAULT_BEHAVIOR ) ;
202198 }
199+ }
200+
201+ export class OpenDeclarationToTheSideAction extends BaseGoToDeclarationAction {
203202
204- protected get behaviour ( ) : Behaviour {
205- return Behaviour . WidgetFocus | Behaviour . UpdateOnCursorPositionChange ;
203+ public static ID = 'editor.action.openDeclarationToTheSide' ;
204+
205+ constructor (
206+ descriptor : editorCommon . IEditorActionDescriptorData ,
207+ editor : editorCommon . ICommonCodeEditor ,
208+ @IMessageService messageService : IMessageService ,
209+ @IEditorService editorService : IEditorService
210+ ) {
211+ super ( descriptor , editor , messageService , editorService , Behaviour . WidgetFocus | Behaviour . UpdateOnCursorPositionChange ) ;
206212 }
207213
208214 protected get openToTheSide ( ) : boolean {
209215 return true ;
210216 }
211217}
212218
213- export class PreviewDeclarationAction extends GoToDeclarationAction {
219+ export class PreviewDeclarationAction extends BaseGoToDeclarationAction {
214220
215221 public static ID = 'editor.action.previewDeclaration' ;
216222
@@ -220,7 +226,7 @@ export class PreviewDeclarationAction extends GoToDeclarationAction {
220226 @IMessageService messageService : IMessageService ,
221227 @IEditorService editorService : IEditorService
222228 ) {
223- super ( descriptor , editor , messageService , editorService ) ;
229+ super ( descriptor , editor , messageService , editorService , DEFAULT_BEHAVIOR ) ;
224230 }
225231
226232 protected _showSingleReferenceInPeek ( ) {
0 commit comments