Skip to content

Commit

Permalink
Bind command for handling workbench.action.openRecent request
Browse files Browse the repository at this point in the history
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
  • Loading branch information
vzhukovs committed May 14, 2020
1 parent 639c9d5 commit 4b6bccf
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { Position } from '@theia/plugin-ext/lib/common/plugin-api-rpc';
import { URI } from 'vscode-uri';
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
import { QuickOpenWorkspace } from '@theia/workspace/lib/browser/quick-open-workspace';

export namespace VscodeCommands {
export const OPEN: Command = {
Expand Down Expand Up @@ -90,6 +91,8 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
protected readonly workspaceService: WorkspaceService;
@inject(TerminalFrontendContribution)
protected readonly terminalContribution: TerminalFrontendContribution;
@inject(QuickOpenWorkspace)
protected readonly quickOpenWorkspace: QuickOpenWorkspace;

registerCommands(commands: CommandRegistry): void {
commands.registerCommand(VscodeCommands.OPEN, {
Expand Down Expand Up @@ -570,5 +573,11 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
commands.executeCommand<CallHierarchyOutgoingCall[]>('_executeProvideOutgoingCalls', { item }))
}
);

commands.registerCommand({
id: 'workbench.action.openRecent'
}, {
execute: () => this.quickOpenWorkspace.select()
});
}
}

0 comments on commit 4b6bccf

Please sign in to comment.