Skip to content

Commit

Permalink
Explorer commands are overly specific (fixes #21102)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Feb 24, 2017
1 parent 31268f3 commit e36134f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/vs/workbench/parts/files/browser/fileActions.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});

KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'filesExplorer.rename',
id: 'renameFile',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: FilesExplorerFocusCondition,
primary: KeyCode.F2,
Expand All @@ -264,7 +264,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});

KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'filesExplorer.moveFileToTrash',
id: 'moveFileToTrash',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: FilesExplorerFocusCondition,
primary: KeyCode.Delete,
Expand All @@ -275,7 +275,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});

KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'filesExplorer.deleteFile',
id: 'deleteFile',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: FilesExplorerFocusCondition,
primary: KeyMod.Shift | KeyCode.Delete,
Expand All @@ -302,7 +302,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});

KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'explorer.copyPath',
id: 'copyFilePath',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: ExplorerFocusCondition,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_C,
Expand All @@ -313,7 +313,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});

KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'explorer.revealInOS',
id: 'revealFileInOS',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: ExplorerFocusCondition,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_R,
Expand Down
8 changes: 4 additions & 4 deletions src/vs/workbench/parts/files/browser/fileActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class BaseFileAction extends Action {

export class TriggerRenameFileAction extends BaseFileAction {

public static ID = 'filesExplorer.rename';
public static ID = 'renameFile';

private tree: ITree;
private renameAction: BaseRenameAction;
Expand Down Expand Up @@ -746,7 +746,7 @@ export class BaseDeleteFileAction extends BaseFileAction {

/* Move File/Folder to trash */
export class MoveFileToTrashAction extends BaseDeleteFileAction {
public static ID = 'filesExplorer.moveFileToTrash';
public static ID = 'moveFileToTrash';

constructor(
tree: ITree,
Expand Down Expand Up @@ -1845,7 +1845,7 @@ export class RevealInOSAction extends Action {
private resource: URI,
@IInstantiationService private instantiationService: IInstantiationService
) {
super('explorer.revealInOS', RevealInOSAction.LABEL);
super('revealFileInOS', RevealInOSAction.LABEL);

this.order = 45;
}
Expand Down Expand Up @@ -1892,7 +1892,7 @@ export class CopyPathAction extends Action {
private resource: URI,
@IInstantiationService private instantiationService: IInstantiationService
) {
super('explorer.copyPath', CopyPathAction.LABEL);
super('copyFilePath', CopyPathAction.LABEL);

this.order = 140;
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/parts/files/browser/fileCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ function withFocusedExplorerItem(accessor: ServicesAccessor): TPromise<FileStat
};

export const renameFocusedFilesExplorerViewItemCommand = (accessor: ServicesAccessor) => {
runActionOnFocusedFilesExplorerViewItem(accessor, 'filesExplorer.rename');
runActionOnFocusedFilesExplorerViewItem(accessor, 'renameFile');
};

export const deleteFocusedFilesExplorerViewItemCommand = (accessor: ServicesAccessor) => {
runActionOnFocusedFilesExplorerViewItem(accessor, 'filesExplorer.moveFileToTrash', { useTrash: false });
runActionOnFocusedFilesExplorerViewItem(accessor, 'moveFileToTrash', { useTrash: false });
};

export const moveFocusedFilesExplorerViewItemToTrashCommand = (accessor: ServicesAccessor) => {
runActionOnFocusedFilesExplorerViewItem(accessor, 'filesExplorer.moveFileToTrash', { useTrash: true });
runActionOnFocusedFilesExplorerViewItem(accessor, 'moveFileToTrash', { useTrash: true });
};

export const copyFocusedFilesExplorerViewItem = (accessor: ServicesAccessor) => {
Expand Down

0 comments on commit e36134f

Please sign in to comment.