diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts index 62652183f85e3398bc2723d65c4ec71855f32ff9..bf16fdb2c526e1ad786fb0ad741c8d760efb4d8b 100644 --- a/src/vs/workbench/api/node/extHostApiCommands.ts +++ b/src/vs/workbench/api/node/extHostApiCommands.ts @@ -239,6 +239,15 @@ export class ExtHostApiCommands { { name: 'columnOrOptions', description: '(optional) Either the column in which to open or editor options, see vscode.TextDocumentShowOptions', constraint: v => v === void 0 || typeof v === 'number' || typeof v === 'object' } ] }); + + this._register('vscode.removeFromRecentlyOpened', (path: string) => { + return this._commands.executeCommand('_workbench.removeFromRecentlyOpened', path); + }, { + description: 'Removes an entry with the given path from the recently opened list.', + args: [ + { name: 'path', description: 'Path to remove from recently opened.', constraint: value => typeof value === 'string' } + ] + }); } // --- command impl diff --git a/src/vs/workbench/electron-browser/commands.ts b/src/vs/workbench/electron-browser/commands.ts index bcd9b64de450e966154f0bfb4262888206a1b567..f222e0476879b0ed4d333df8a8b64de6c306571f 100644 --- a/src/vs/workbench/electron-browser/commands.ts +++ b/src/vs/workbench/electron-browser/commands.ts @@ -528,4 +528,12 @@ export function registerCommands(): void { return void 0; }); }); + + CommandsRegistry.registerCommand('_workbench.removeFromRecentlyOpened', function (accessor: ServicesAccessor, path: string) { + const windowsService = accessor.get(IWindowsService); + + return windowsService.removeFromRecentlyOpened([path]).then(() => { + return void 0; + }); + }); }