Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
goMain.ts add commands to Go: Show All Commands (#1952)
Browse files Browse the repository at this point in the history
* goMain.ts add commands to Go: Show All Commands
commands added :
 * Go to definition
 * Go to implementation
 * Go to symbol in file
 * Go to symbol in workspace

fixes #1822

* Skip descriptions as they dont get shown in the UI
  • Loading branch information
vimalk78 authored and ramya-rao-a committed Oct 10, 2018
1 parent 8a52292 commit 8c57367
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,25 @@ export function activate(ctx: vscode.ExtensionContext): void {
}));

ctx.subscriptions.push(vscode.commands.registerCommand('go.show.commands', () => {
vscode.window.showQuickPick(getExtensionCommands().map(x => x.title)).then(cmd => {
let selectedCmd = getExtensionCommands().find(x => x.title === cmd);
let extCommands = getExtensionCommands();
extCommands.push({
command : 'editor.action.goToDeclaration',
title : 'Go to Definition'
});
extCommands.push({
command : 'editor.action.goToImplementation',
title : 'Go to Implementation'
});
extCommands.push({
command : 'workbench.action.gotoSymbol',
title : 'Go to Symbol in File...'
});
extCommands.push({
command : 'workbench.action.showAllSymbols',
title : 'Go to Symbol in Workspace...'
});
vscode.window.showQuickPick(extCommands.map(x => x.title)).then(cmd => {
let selectedCmd = extCommands.find(x => x.title === cmd);
if (selectedCmd) {
vscode.commands.executeCommand(selectedCmd.command);
}
Expand Down

0 comments on commit 8c57367

Please # to comment.