@@ -27,6 +27,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
2727import { INotificationService } from 'vs/platform/notification/common/notification' ;
2828import { IProgressService } from 'vs/platform/progress/common/progress' ;
2929import { getDefinitionsAtPosition , getImplementationsAtPosition , getTypeDefinitionsAtPosition , getDeclarationsAtPosition } from './goToDefinition' ;
30+ import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
3031
3132
3233export class DefinitionActionConfig {
@@ -175,60 +176,65 @@ export class DefinitionAction extends EditorAction {
175176 }
176177}
177178
178- const goToDeclarationKb = platform . isWeb
179+ const goToDefinitionKb = platform . isWeb
179180 ? KeyMod . CtrlCmd | KeyCode . F12
180181 : KeyCode . F12 ;
181182
182183export class GoToDefinitionAction extends DefinitionAction {
183184
184- public static readonly ID = 'editor.action.goToDeclaration ' ;
185+ static readonly id = 'editor.action.revealDefinition ' ;
185186
186187 constructor ( ) {
187188 super ( new DefinitionActionConfig ( ) , {
188- id : GoToDefinitionAction . ID ,
189+ id : GoToDefinitionAction . id ,
189190 label : nls . localize ( 'actions.goToDecl.label' , "Go to Definition" ) ,
190191 alias : 'Go to Definition' ,
191192 precondition : ContextKeyExpr . and (
192193 EditorContextKeys . hasDefinitionProvider ,
193194 EditorContextKeys . isInEmbeddedEditor . toNegated ( ) ) ,
194195 kbOpts : {
195196 kbExpr : EditorContextKeys . editorTextFocus ,
196- primary : goToDeclarationKb ,
197+ primary : goToDefinitionKb ,
197198 weight : KeybindingWeight . EditorContrib
198199 } ,
199200 menuOpts : {
200201 group : 'navigation' ,
201202 order : 1.1
202203 }
203204 } ) ;
205+ CommandsRegistry . registerCommandAlias ( 'editor.action.goToDeclaration' , GoToDefinitionAction . id ) ;
204206 }
205207}
206208
207209export class OpenDefinitionToSideAction extends DefinitionAction {
208210
209- public static readonly ID = 'editor.action.openDeclarationToTheSide ' ;
211+ static readonly id = 'editor.action.revealDefinitionAside ' ;
210212
211213 constructor ( ) {
212214 super ( new DefinitionActionConfig ( true ) , {
213- id : OpenDefinitionToSideAction . ID ,
215+ id : OpenDefinitionToSideAction . id ,
214216 label : nls . localize ( 'actions.goToDeclToSide.label' , "Open Definition to the Side" ) ,
215217 alias : 'Open Definition to the Side' ,
216218 precondition : ContextKeyExpr . and (
217219 EditorContextKeys . hasDefinitionProvider ,
218220 EditorContextKeys . isInEmbeddedEditor . toNegated ( ) ) ,
219221 kbOpts : {
220222 kbExpr : EditorContextKeys . editorTextFocus ,
221- primary : KeyChord ( KeyMod . CtrlCmd | KeyCode . KEY_K , goToDeclarationKb ) ,
223+ primary : KeyChord ( KeyMod . CtrlCmd | KeyCode . KEY_K , goToDefinitionKb ) ,
222224 weight : KeybindingWeight . EditorContrib
223225 }
224226 } ) ;
227+ CommandsRegistry . registerCommandAlias ( 'editor.action.openDeclarationToTheSide' , OpenDefinitionToSideAction . id ) ;
225228 }
226229}
227230
228231export class PeekDefinitionAction extends DefinitionAction {
232+
233+ static readonly id = 'editor.action.peekDefinition' ;
234+
229235 constructor ( ) {
230236 super ( new DefinitionActionConfig ( void 0 , true , false ) , {
231- id : 'editor.action.previewDeclaration' ,
237+ id : PeekDefinitionAction . id ,
232238 label : nls . localize ( 'actions.previewDecl.label' , "Peek Definition" ) ,
233239 alias : 'Peek Definition' ,
234240 precondition : ContextKeyExpr . and (
@@ -246,6 +252,7 @@ export class PeekDefinitionAction extends DefinitionAction {
246252 order : 1.2
247253 }
248254 } ) ;
255+ CommandsRegistry . registerCommandAlias ( 'editor.action.previewDeclaration' , PeekDefinitionAction . id ) ;
249256 }
250257}
251258
@@ -268,19 +275,19 @@ export class DeclarationAction extends DefinitionAction {
268275
269276export class GoToDeclarationAction extends DeclarationAction {
270277
271- public static readonly ID = 'editor.action.goToRealDeclaration ' ;
278+ static readonly id = 'editor.action.revealDeclaration ' ;
272279
273280 constructor ( ) {
274281 super ( new DefinitionActionConfig ( ) , {
275- id : GoToDeclarationAction . ID ,
282+ id : GoToDeclarationAction . id ,
276283 label : nls . localize ( 'actions.goToDeclaration.label' , "Go to Declaration" ) ,
277284 alias : 'Go to Declaration' ,
278285 precondition : ContextKeyExpr . and (
279286 EditorContextKeys . hasDeclarationProvider ,
280287 EditorContextKeys . isInEmbeddedEditor . toNegated ( ) ) ,
281288 kbOpts : {
282289 kbExpr : EditorContextKeys . editorTextFocus ,
283- primary : KeyMod . CtrlCmd | KeyCode . F12 ,
290+ primary : KeyMod . Shift | KeyMod . CtrlCmd | KeyCode . F12 ,
284291 weight : KeybindingWeight . EditorContrib
285292 } ,
286293 menuOpts : {
@@ -313,7 +320,7 @@ export class PeekDeclarationAction extends DeclarationAction {
313320 EditorContextKeys . isInEmbeddedEditor . toNegated ( ) ) ,
314321 kbOpts : {
315322 kbExpr : EditorContextKeys . editorTextFocus ,
316- primary : KeyMod . Alt | KeyCode . F12 ,
323+ primary : KeyMod . Shift | KeyMod . Alt | KeyCode . F12 ,
317324 linux : { primary : KeyMod . CtrlCmd | KeyMod . Shift | KeyCode . F10 } ,
318325 weight : KeybindingWeight . EditorContrib
319326 } ,
0 commit comments