本文整理汇总了TypeScript中vs/workbench/common/resources.ResourceContextKey.Scheme类的典型用法代码示例。如果您正苦于以下问题:TypeScript ResourceContextKey.Scheme类的具体用法?TypeScript ResourceContextKey.Scheme怎么用?TypeScript ResourceContextKey.Scheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ResourceContextKey.Scheme类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: appendEditorTitleContextMenuItem
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
handler: copyFileHandler,
});
const PASTE_FILE_ID = 'filesExplorer.paste';
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: PASTE_FILE_ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(explorerCommandsWeightBonus),
when: ContextKeyExpr.and(FilesExplorerFocusCondition, FileCopiedContext),
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
handler: pasteFileHandler
});
// Editor Title Context Menu
appendEditorTitleContextMenuItem(REVEAL_IN_OS_COMMAND_ID, REVEAL_IN_OS_LABEL, ResourceContextKey.Scheme.isEqualTo('file'));
appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, CopyPathAction.LABEL, ResourceContextKey.IsFile);
appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, nls.localize('revealInSideBar', "Reveal in Side Bar"), ResourceContextKey.IsFile);
function appendEditorTitleContextMenuItem(id: string, title: string, when: ContextKeyExpr): void {
// Menu
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, {
command: { id, title },
when,
group: '2_files'
});
}
// Editor Title Menu for Conflict Resolution
appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', nls.localize('acceptLocalChanges', "Use your changes and overwrite disk contents"), 'save-conflict-action-accept-changes', -10, acceptLocalChangesCommand);
开发者ID:servicesgpr,项目名称:vscode,代码行数:31,代码来源:fileActions.contribution.ts
示例2:
}
}
});
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: OPEN_NATIVE_CONSOLE_COMMAND_ID,
title: env.isWindows ? nls.localize('globalConsoleActionWin', "Open New Command Prompt") :
nls.localize('globalConsoleActionMacLinux', "Open New Terminal")
}
});
const openConsoleCommand = {
id: OPEN_IN_TERMINAL_COMMAND_ID,
title: env.isWindows ? nls.localize('scopedConsoleActionWin', "Open in Command Prompt") :
nls.localize('scopedConsoleActionMacLinux', "Open in Terminal")
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: 'navigation',
order: 30,
command: openConsoleCommand,
when: ResourceContextKey.Scheme.isEqualTo(Schemas.file)
});
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
group: 'navigation',
order: 30,
command: openConsoleCommand,
when: ResourceContextKey.Scheme.isEqualTo(Schemas.file)
});
开发者ID:liunian,项目名称:vscode,代码行数:30,代码来源:execution.contribution.ts
注:本文中的vs/workbench/common/resources.ResourceContextKey.Scheme类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论