Skip to content

Commit

Permalink
Add peek implemenation command Fixes microsoft#18481
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Jan 13, 2017
1 parent 269d1f3 commit 45b2217
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,32 @@ export class GoToImplementationAction extends DefinitionAction {
}
}

@editorAction
export class PeekImplementationAction extends DefinitionAction {

public static ID = 'editor.action.peekImplementation';

constructor() {
super(new DefinitionActionConfig(false, true, false), {
id: PeekImplementationAction.ID,
label: nls.localize('actions.peekImplementation.label', "Peek Implementation"),
alias: 'Peek Implementation',
precondition: ModeContextKeys.hasTypeDefinitionProvider,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12
},
menuOpts: {
group: 'navigation',
order: 1.3
}
});
}

protected getDeclarationsAtPosition(model: editorCommon.IModel, position: corePosition.Position): TPromise<Location[]> {
return getTypeDefinitionAtPosition(model, position);
}
}

// --- Editor Contribution to goto definition using the mouse and a modifier key

Expand Down

0 comments on commit 45b2217

Please sign in to comment.