提交 e36134fa 编写于 作者: B Benjamin Pasero

Explorer commands are overly specific (fixes #21102)

上级 31268f37
......@@ -253,7 +253,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'filesExplorer.rename',
id: 'renameFile',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: FilesExplorerFocusCondition,
primary: KeyCode.F2,
......@@ -264,7 +264,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'filesExplorer.moveFileToTrash',
id: 'moveFileToTrash',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: FilesExplorerFocusCondition,
primary: KeyCode.Delete,
......@@ -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,
......@@ -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,
......@@ -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,
......
......@@ -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;
......@@ -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,
......@@ -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;
}
......@@ -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;
}
......
......@@ -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) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册