Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task Experiment 1.1 #28565

Merged
merged 3 commits into from
Jun 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vs/code/electron-main/menus.ts
Expand Up @@ -586,6 +586,7 @@ export class CodeMenu {
const output = this.createMenuItem(nls.localize({ key: 'miToggleOutput', comment: ['&& denotes a mnemonic'] }, "&&Output"), 'workbench.action.output.toggleOutput');
const debugConsole = this.createMenuItem(nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console"), 'workbench.debug.action.toggleRepl');
const integratedTerminal = this.createMenuItem(nls.localize({ key: 'miToggleIntegratedTerminal', comment: ['&& denotes a mnemonic'] }, "&&Integrated Terminal"), 'workbench.action.terminal.toggleTerminal');
const taskMenu = this.createMenuItem(nls.localize({ key: 'miShowTask', comment: ['&& denotes a mnemonic'] }, "Show Tas&&ks..."), 'workbench.action.showTasks');
const problems = this.createMenuItem(nls.localize({ key: 'miMarker', comment: ['&& denotes a mnemonic'] }, "&&Problems"), 'workbench.actions.view.problems');

let additionalViewlets: Electron.MenuItem;
Expand Down Expand Up @@ -657,6 +658,7 @@ export class CodeMenu {
problems,
debugConsole,
integratedTerminal,
taskMenu,
__separator__(),
fullscreen,
toggleZenMode,
Expand Down
22 changes: 22 additions & 0 deletions src/vs/workbench/parts/quickopen/browser/commandsHandler.ts
Expand Up @@ -149,6 +149,28 @@ export class ShowAllCommandsAction extends Action {
}
}

export class ShowTasksAction extends Action {

public static ID = 'workbench.action.showTasks';
public static LABEL = nls.localize('showTasks', "Show Task Menu");

constructor(
id: string,
label: string,
@IQuickOpenService private quickOpenService: IQuickOpenService,
@IConfigurationService private configurationService: IConfigurationService
) {
super(id, label);
}

public run(context?: any): TPromise<any> {
const value = `${ALL_COMMANDS_PREFIX}tasks`;
this.quickOpenService.show(value);

return TPromise.as(null);
}
}

export class ClearCommandHistoryAction extends Action {

public static ID = 'workbench.action.clearCommandHistory';
Expand Down
Expand Up @@ -13,7 +13,7 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { GotoSymbolAction, GOTO_SYMBOL_PREFIX, SCOPE_PREFIX } from 'vs/workbench/parts/quickopen/browser/gotoSymbolHandler';
import { ShowAllCommandsAction, ALL_COMMANDS_PREFIX, ClearCommandHistoryAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler';
import { ShowAllCommandsAction, ALL_COMMANDS_PREFIX, ClearCommandHistoryAction, ShowTasksAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler';
import { GotoLineAction, GOTO_LINE_PREFIX } from 'vs/workbench/parts/quickopen/browser/gotoLineHandler';
import { HELP_PREFIX } from 'vs/workbench/parts/quickopen/browser/helpHandler';
import { VIEW_PICKER_PREFIX, OpenViewPickerAction, QuickOpenViewPickerAction } from 'vs/workbench/parts/quickopen/browser/viewPickerHandler';
Expand All @@ -40,6 +40,10 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenViewPickerAct
primary: KeyMod.CtrlCmd | KeyCode.KEY_Q, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_Q }, linux: { primary: null }
}), 'Quick Open View');

registry.registerWorkbenchAction(new SyncActionDescriptor(ShowTasksAction, ShowTasksAction.ID, ShowTasksAction.LABEL, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmd+shift+t is taken by 'Reopen closed editor'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a keyboard shortcut is a good idea though. Not sure whether we have a similar pattern to copy yet? ie another shortcut that opens the command palette to see several commands.

primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_T
}), 'Show Task Menu');

// Register Quick Open Handler

Registry.as<IQuickOpenRegistry>(QuickOpenExtensions.Quickopen).registerQuickOpenHandler(
Expand Down