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

goMain.ts add commands to Go: Show All Commands #1952

Merged
merged 2 commits into from
Oct 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,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