提交 2a18cb8e 编写于 作者: B Benjamin Pasero

recently opened: some renames

上级 0373d29d
...@@ -385,7 +385,7 @@ export class CodeApplication { ...@@ -385,7 +385,7 @@ export class CodeApplication {
// Jump List // Jump List
this.historyService.updateWindowsJumpList(); this.historyService.updateWindowsJumpList();
this.historyService.onRecentPathsChange(() => this.historyService.updateWindowsJumpList()); this.historyService.onRecentlyOpenedChange(() => this.historyService.updateWindowsJumpList());
// Start shared process here // Start shared process here
this.sharedProcess.spawn(); this.sharedProcess.spawn();
......
...@@ -100,7 +100,7 @@ export class CodeMenu { ...@@ -100,7 +100,7 @@ export class CodeMenu {
// Listen to some events from window service // Listen to some events from window service
this.windowsService.onPathsOpen(paths => this.updateMenu()); this.windowsService.onPathsOpen(paths => this.updateMenu());
this.historyService.onRecentPathsChange(paths => this.updateMenu()); this.historyService.onRecentlyOpenedChange(paths => this.updateMenu());
this.windowsService.onWindowClose(_ => this.onClose(this.windowsService.getWindowCount())); this.windowsService.onWindowClose(_ => this.onClose(this.windowsService.getWindowCount()));
// Listen to extension viewlets // Listen to extension viewlets
...@@ -428,7 +428,7 @@ export class CodeMenu { ...@@ -428,7 +428,7 @@ export class CodeMenu {
private setOpenRecentMenu(openRecentMenu: Electron.Menu): void { private setOpenRecentMenu(openRecentMenu: Electron.Menu): void {
openRecentMenu.append(this.createMenuItem(nls.localize({ key: 'miReopenClosedEditor', comment: ['&& denotes a mnemonic'] }, "&&Reopen Closed Editor"), 'workbench.action.reopenClosedEditor')); openRecentMenu.append(this.createMenuItem(nls.localize({ key: 'miReopenClosedEditor', comment: ['&& denotes a mnemonic'] }, "&&Reopen Closed Editor"), 'workbench.action.reopenClosedEditor'));
const { folders, files } = this.historyService.getRecentPathsList(); const { folders, files } = this.historyService.getRecentlyOpened();
// Folders // Folders
if (folders.length > 0) { if (folders.length > 0) {
...@@ -462,7 +462,7 @@ export class CodeMenu { ...@@ -462,7 +462,7 @@ export class CodeMenu {
const openInNewWindow = this.isOptionClick(event); const openInNewWindow = this.isOptionClick(event);
const success = this.windowsService.open({ context: OpenContext.MENU, cli: this.environmentService.args, pathsToOpen: [path], forceNewWindow: openInNewWindow }).length > 0; const success = this.windowsService.open({ context: OpenContext.MENU, cli: this.environmentService.args, pathsToOpen: [path], forceNewWindow: openInNewWindow }).length > 0;
if (!success) { if (!success) {
this.historyService.removeFromRecentPathsList(path); this.historyService.removeFromRecentlyOpened(path);
} }
} }
}, false)); }, false));
......
...@@ -343,16 +343,16 @@ export class WindowsManager implements IWindowsMainService { ...@@ -343,16 +343,16 @@ export class WindowsManager implements IWindowsMainService {
// Remember in recent document list (unless this opens for extension development) // Remember in recent document list (unless this opens for extension development)
// Also do not add paths when files are opened for diffing, only if opened individually // Also do not add paths when files are opened for diffing, only if opened individually
if (!usedWindows.some(w => w.isExtensionDevelopmentHost) && !openConfig.cli.diff) { if (!usedWindows.some(w => w.isExtensionDevelopmentHost) && !openConfig.cli.diff) {
const recentPaths: { path: string; isFile?: boolean; }[] = []; const recentlyOpened: { path: string; isFile?: boolean; }[] = [];
windowsToOpen.forEach(win => { windowsToOpen.forEach(win => {
if (win.filePath || win.folderPath) { if (win.filePath || win.folderPath) {
recentPaths.push({ path: win.filePath || win.folderPath, isFile: !!win.filePath }); recentlyOpened.push({ path: win.filePath || win.folderPath, isFile: !!win.filePath });
} }
}); });
if (recentPaths.length) { if (recentlyOpened.length) {
this.historyService.addToRecentPathsList(recentPaths); this.historyService.addToRecentlyOpened(recentlyOpened);
} }
} }
...@@ -777,7 +777,7 @@ export class WindowsManager implements IWindowsMainService { ...@@ -777,7 +777,7 @@ export class WindowsManager implements IWindowsMainService {
}; };
} }
} catch (error) { } catch (error) {
this.historyService.removeFromRecentPathsList(candidate); // since file does not seem to exist anymore, remove from recent this.historyService.removeFromRecentlyOpened(candidate); // since file does not seem to exist anymore, remove from recent
if (ignoreFileNotFound) { if (ignoreFileNotFound) {
return { filePath: candidate, createFilePath: true }; // assume this is a file that does not yet exist return { filePath: candidate, createFilePath: true }; // assume this is a file that does not yet exist
......
...@@ -20,7 +20,7 @@ import { isWindows, isMacintosh, isLinux } from 'vs/base/common/platform'; ...@@ -20,7 +20,7 @@ import { isWindows, isMacintosh, isLinux } from 'vs/base/common/platform';
export const IHistoryMainService = createDecorator<IHistoryMainService>('historyMainService'); export const IHistoryMainService = createDecorator<IHistoryMainService>('historyMainService');
export interface IRecentPathsList { export interface IRecentlyOpened {
folders: string[]; folders: string[];
files: string[]; files: string[];
} }
...@@ -29,15 +29,14 @@ export interface IHistoryMainService { ...@@ -29,15 +29,14 @@ export interface IHistoryMainService {
_serviceBrand: any; _serviceBrand: any;
// events // events
onRecentPathsChange: CommonEvent<void>; onRecentlyOpenedChange: CommonEvent<void>;
// methods // methods
addToRecentlyOpened(paths: { path: string; isFile?: boolean; }[]): void;
addToRecentPathsList(paths: { path: string; isFile?: boolean; }[]): void; getRecentlyOpened(folderPath?: string, filesToOpen?: IPath[]): IRecentlyOpened;
getRecentPathsList(folderPath?: string, filesToOpen?: IPath[]): IRecentPathsList; removeFromRecentlyOpened(path: string): void;
removeFromRecentPathsList(path: string): void; removeFromRecentlyOpened(paths: string[]): void;
removeFromRecentPathsList(paths: string[]): void; clearRecentlyOpened(): void;
clearRecentPathsList(): void;
updateWindowsJumpList(): void; updateWindowsJumpList(): void;
} }
...@@ -45,12 +44,12 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -45,12 +44,12 @@ export class HistoryMainService implements IHistoryMainService {
private static MAX_TOTAL_RECENT_ENTRIES = 100; private static MAX_TOTAL_RECENT_ENTRIES = 100;
private static recentPathsListStorageKey = 'openedPathsList'; private static recentlyOpenedStorageKey = 'openedPathsList';
_serviceBrand: any; _serviceBrand: any;
private _onRecentPathsChange = new Emitter<void>(); private _onRecentlyOpenedChange = new Emitter<void>();
onRecentPathsChange: CommonEvent<void> = this._onRecentPathsChange.event; onRecentlyOpenedChange: CommonEvent<void> = this._onRecentlyOpenedChange.event;
constructor( constructor(
@IStorageService private storageService: IStorageService, @IStorageService private storageService: IStorageService,
...@@ -58,12 +57,12 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -58,12 +57,12 @@ export class HistoryMainService implements IHistoryMainService {
) { ) {
} }
public addToRecentPathsList(paths: { path: string; isFile?: boolean; }[]): void { public addToRecentlyOpened(paths: { path: string; isFile?: boolean; }[]): void {
if (!paths || !paths.length) { if (!paths || !paths.length) {
return; return;
} }
const mru = this.getRecentPathsList(); const mru = this.getRecentlyOpened();
paths.forEach(p => { paths.forEach(p => {
const { path, isFile } = p; const { path, isFile } = p;
...@@ -85,13 +84,13 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -85,13 +84,13 @@ export class HistoryMainService implements IHistoryMainService {
} }
}); });
this.storageService.setItem(HistoryMainService.recentPathsListStorageKey, mru); this.storageService.setItem(HistoryMainService.recentlyOpenedStorageKey, mru);
this._onRecentPathsChange.fire(); this._onRecentlyOpenedChange.fire();
} }
public removeFromRecentPathsList(path: string): void; public removeFromRecentlyOpened(path: string): void;
public removeFromRecentPathsList(paths: string[]): void; public removeFromRecentlyOpened(paths: string[]): void;
public removeFromRecentPathsList(arg1: any): void { public removeFromRecentlyOpened(arg1: any): void {
let paths: string[]; let paths: string[];
if (Array.isArray(arg1)) { if (Array.isArray(arg1)) {
paths = arg1; paths = arg1;
...@@ -99,7 +98,7 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -99,7 +98,7 @@ export class HistoryMainService implements IHistoryMainService {
paths = [arg1]; paths = [arg1];
} }
const mru = this.getRecentPathsList(); const mru = this.getRecentlyOpened();
let update = false; let update = false;
paths.forEach(path => { paths.forEach(path => {
...@@ -117,25 +116,25 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -117,25 +116,25 @@ export class HistoryMainService implements IHistoryMainService {
}); });
if (update) { if (update) {
this.storageService.setItem(HistoryMainService.recentPathsListStorageKey, mru); this.storageService.setItem(HistoryMainService.recentlyOpenedStorageKey, mru);
this._onRecentPathsChange.fire(); this._onRecentlyOpenedChange.fire();
} }
} }
public clearRecentPathsList(): void { public clearRecentlyOpened(): void {
this.storageService.setItem(HistoryMainService.recentPathsListStorageKey, { folders: [], files: [] }); this.storageService.setItem(HistoryMainService.recentlyOpenedStorageKey, { folders: [], files: [] });
app.clearRecentDocuments(); app.clearRecentDocuments();
// Event // Event
this._onRecentPathsChange.fire(); this._onRecentlyOpenedChange.fire();
} }
public getRecentPathsList(folderPath?: string, filesToOpen?: IPath[]): IRecentPathsList { public getRecentlyOpened(folderPath?: string, filesToOpen?: IPath[]): IRecentlyOpened {
let files: string[]; let files: string[];
let folders: string[]; let folders: string[];
// Get from storage // Get from storage
const storedRecents = this.storageService.getItem<IRecentPathsList>(HistoryMainService.recentPathsListStorageKey); const storedRecents = this.storageService.getItem<IRecentlyOpened>(HistoryMainService.recentlyOpenedStorageKey);
if (storedRecents) { if (storedRecents) {
files = storedRecents.files || []; files = storedRecents.files || [];
folders = storedRecents.folders || []; folders = storedRecents.folders || [];
...@@ -185,19 +184,19 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -185,19 +184,19 @@ export class HistoryMainService implements IHistoryMainService {
}); });
// Recent Folders // Recent Folders
if (this.getRecentPathsList().folders.length > 0) { if (this.getRecentlyOpened().folders.length > 0) {
// The user might have meanwhile removed items from the jump list and we have to respect that // The user might have meanwhile removed items from the jump list and we have to respect that
// so we need to update our list of recent paths with the choice of the user to not add them again // so we need to update our list of recent paths with the choice of the user to not add them again
// Also: Windows will not show our custom category at all if there is any entry which was removed // Also: Windows will not show our custom category at all if there is any entry which was removed
// by the user! See https://github.com/Microsoft/vscode/issues/15052 // by the user! See https://github.com/Microsoft/vscode/issues/15052
this.removeFromRecentPathsList(app.getJumpListSettings().removedItems.map(r => trim(r.args, '"'))); this.removeFromRecentlyOpened(app.getJumpListSettings().removedItems.map(r => trim(r.args, '"')));
// Add entries // Add entries
jumpList.push({ jumpList.push({
type: 'custom', type: 'custom',
name: nls.localize('recentFolders', "Recent Folders"), name: nls.localize('recentFolders', "Recent Folders"),
items: this.getRecentPathsList().folders.slice(0, 7 /* limit number of entries here */).map(folder => { items: this.getRecentlyOpened().folders.slice(0, 7 /* limit number of entries here */).map(folder => {
return <Electron.JumpListItem>{ return <Electron.JumpListItem>{
type: 'task', type: 'task',
title: path.basename(folder) || folder, // use the base name to show shorter entries in the list title: path.basename(folder) || folder, // use the base name to show shorter entries in the list
......
...@@ -32,10 +32,10 @@ export interface IWindowsService { ...@@ -32,10 +32,10 @@ export interface IWindowsService {
closeFolder(windowId: number): TPromise<void>; closeFolder(windowId: number): TPromise<void>;
toggleFullScreen(windowId: number): TPromise<void>; toggleFullScreen(windowId: number): TPromise<void>;
setRepresentedFilename(windowId: number, fileName: string): TPromise<void>; setRepresentedFilename(windowId: number, fileName: string): TPromise<void>;
addToRecentlyOpen(paths: { path: string, isFile?: boolean }[]): TPromise<void>; addToRecentlyOpened(paths: { path: string, isFile?: boolean }[]): TPromise<void>;
removeFromRecentlyOpen(paths: string[]): TPromise<void>; removeFromRecentlyOpened(paths: string[]): TPromise<void>;
clearRecentPathsList(): TPromise<void>; clearRecentlyOpened(): TPromise<void>;
getRecentlyOpen(windowId: number): TPromise<{ files: string[]; folders: string[]; }>; getRecentlyOpened(windowId: number): TPromise<{ files: string[]; folders: string[]; }>;
focusWindow(windowId: number): TPromise<void>; focusWindow(windowId: number): TPromise<void>;
closeWindow(windowId: number): TPromise<void>; closeWindow(windowId: number): TPromise<void>;
isFocused(windowId: number): TPromise<boolean>; isFocused(windowId: number): TPromise<boolean>;
...@@ -87,7 +87,7 @@ export interface IWindowService { ...@@ -87,7 +87,7 @@ export interface IWindowService {
closeFolder(): TPromise<void>; closeFolder(): TPromise<void>;
toggleFullScreen(): TPromise<void>; toggleFullScreen(): TPromise<void>;
setRepresentedFilename(fileName: string): TPromise<void>; setRepresentedFilename(fileName: string): TPromise<void>;
getRecentlyOpen(): TPromise<{ files: string[]; folders: string[]; }>; getRecentlyOpened(): TPromise<{ files: string[]; folders: string[]; }>;
focusWindow(): TPromise<void>; focusWindow(): TPromise<void>;
closeWindow(): TPromise<void>; closeWindow(): TPromise<void>;
isFocused(): TPromise<boolean>; isFocused(): TPromise<boolean>;
......
...@@ -23,10 +23,10 @@ export interface IWindowsChannel extends IChannel { ...@@ -23,10 +23,10 @@ export interface IWindowsChannel extends IChannel {
call(command: 'closeFolder', arg: number): TPromise<void>; call(command: 'closeFolder', arg: number): TPromise<void>;
call(command: 'toggleFullScreen', arg: number): TPromise<void>; call(command: 'toggleFullScreen', arg: number): TPromise<void>;
call(command: 'setRepresentedFilename', arg: [number, string]): TPromise<void>; call(command: 'setRepresentedFilename', arg: [number, string]): TPromise<void>;
call(command: 'addToRecentlyOpen', arg: { path: string, isFile?: boolean }[]): TPromise<void>; call(command: 'addToRecentlyOpened', arg: { path: string, isFile?: boolean }[]): TPromise<void>;
call(command: 'removeFromRecentlyOpen', arg: string[]): TPromise<void>; call(command: 'removeFromRecentlyOpened', arg: string[]): TPromise<void>;
call(command: 'clearRecentPathsList'): TPromise<void>; call(command: 'clearRecentlyOpened'): TPromise<void>;
call(command: 'getRecentlyOpen', arg: number): TPromise<{ files: string[]; folders: string[]; }>; call(command: 'getRecentlyOpened', arg: number): TPromise<{ files: string[]; folders: string[]; }>;
call(command: 'focusWindow', arg: number): TPromise<void>; call(command: 'focusWindow', arg: number): TPromise<void>;
call(command: 'closeWindow', arg: number): TPromise<void>; call(command: 'closeWindow', arg: number): TPromise<void>;
call(command: 'isFocused', arg: number): TPromise<boolean>; call(command: 'isFocused', arg: number): TPromise<boolean>;
...@@ -76,10 +76,10 @@ export class WindowsChannel implements IWindowsChannel { ...@@ -76,10 +76,10 @@ export class WindowsChannel implements IWindowsChannel {
case 'closeFolder': return this.service.closeFolder(arg); case 'closeFolder': return this.service.closeFolder(arg);
case 'toggleFullScreen': return this.service.toggleFullScreen(arg); case 'toggleFullScreen': return this.service.toggleFullScreen(arg);
case 'setRepresentedFilename': return this.service.setRepresentedFilename(arg[0], arg[1]); case 'setRepresentedFilename': return this.service.setRepresentedFilename(arg[0], arg[1]);
case 'addToRecentlyOpen': return this.service.addToRecentlyOpen(arg); case 'addToRecentlyOpened': return this.service.addToRecentlyOpened(arg);
case 'removeFromRecentlyOpen': return this.service.removeFromRecentlyOpen(arg); case 'removeFromRecentlyOpened': return this.service.removeFromRecentlyOpened(arg);
case 'clearRecentPathsList': return this.service.clearRecentPathsList(); case 'clearRecentlyOpened': return this.service.clearRecentlyOpened();
case 'getRecentlyOpen': return this.service.getRecentlyOpen(arg); case 'getRecentlyOpened': return this.service.getRecentlyOpened(arg);
case 'focusWindow': return this.service.focusWindow(arg); case 'focusWindow': return this.service.focusWindow(arg);
case 'closeWindow': return this.service.closeWindow(arg); case 'closeWindow': return this.service.closeWindow(arg);
case 'isFocused': return this.service.isFocused(arg); case 'isFocused': return this.service.isFocused(arg);
...@@ -159,20 +159,20 @@ export class WindowsChannelClient implements IWindowsService { ...@@ -159,20 +159,20 @@ export class WindowsChannelClient implements IWindowsService {
return this.channel.call('setRepresentedFilename', [windowId, fileName]); return this.channel.call('setRepresentedFilename', [windowId, fileName]);
} }
addToRecentlyOpen(paths: { path: string, isFile?: boolean }[]): TPromise<void> { addToRecentlyOpened(paths: { path: string, isFile?: boolean }[]): TPromise<void> {
return this.channel.call('addToRecentlyOpen', paths); return this.channel.call('addToRecentlyOpened', paths);
} }
removeFromRecentlyOpen(paths: string[]): TPromise<void> { removeFromRecentlyOpened(paths: string[]): TPromise<void> {
return this.channel.call('removeFromRecentlyOpen', paths); return this.channel.call('removeFromRecentlyOpened', paths);
} }
clearRecentPathsList(): TPromise<void> { clearRecentlyOpened(): TPromise<void> {
return this.channel.call('clearRecentPathsList'); return this.channel.call('clearRecentlyOpened');
} }
getRecentlyOpen(windowId: number): TPromise<{ files: string[]; folders: string[]; }> { getRecentlyOpened(windowId: number): TPromise<{ files: string[]; folders: string[]; }> {
return this.channel.call('getRecentlyOpen', windowId); return this.channel.call('getRecentlyOpened', windowId);
} }
focusWindow(windowId: number): TPromise<void> { focusWindow(windowId: number): TPromise<void> {
......
...@@ -67,8 +67,8 @@ export class WindowService implements IWindowService { ...@@ -67,8 +67,8 @@ export class WindowService implements IWindowService {
return this.windowsService.setRepresentedFilename(this.windowId, fileName); return this.windowsService.setRepresentedFilename(this.windowId, fileName);
} }
getRecentlyOpen(): TPromise<{ files: string[]; folders: string[]; }> { getRecentlyOpened(): TPromise<{ files: string[]; folders: string[]; }> {
return this.windowsService.getRecentlyOpen(this.windowId); return this.windowsService.getRecentlyOpened(this.windowId);
} }
focusWindow(): TPromise<void> { focusWindow(): TPromise<void> {
......
...@@ -139,28 +139,28 @@ export class WindowsService implements IWindowsService, IDisposable { ...@@ -139,28 +139,28 @@ export class WindowsService implements IWindowsService, IDisposable {
return TPromise.as(null); return TPromise.as(null);
} }
addToRecentlyOpen(paths: { path: string, isFile?: boolean }[]): TPromise<void> { addToRecentlyOpened(paths: { path: string, isFile?: boolean }[]): TPromise<void> {
this.historyService.addToRecentPathsList(paths); this.historyService.addToRecentlyOpened(paths);
return TPromise.as(null); return TPromise.as(null);
} }
removeFromRecentlyOpen(paths: string[]): TPromise<void> { removeFromRecentlyOpened(paths: string[]): TPromise<void> {
this.historyService.removeFromRecentPathsList(paths); this.historyService.removeFromRecentlyOpened(paths);
return TPromise.as(null); return TPromise.as(null);
} }
clearRecentPathsList(): TPromise<void> { clearRecentlyOpened(): TPromise<void> {
this.historyService.clearRecentPathsList(); this.historyService.clearRecentlyOpened();
return TPromise.as(null); return TPromise.as(null);
} }
getRecentlyOpen(windowId: number): TPromise<{ files: string[]; folders: string[]; }> { getRecentlyOpened(windowId: number): TPromise<{ files: string[]; folders: string[]; }> {
const codeWindow = this.windowsMainService.getWindowById(windowId); const codeWindow = this.windowsMainService.getWindowById(windowId);
if (codeWindow) { if (codeWindow) {
const { files, folders } = this.historyService.getRecentPathsList(codeWindow.config.folderPath, codeWindow.config.filesToOpen); const { files, folders } = this.historyService.getRecentlyOpened(codeWindow.config.folderPath, codeWindow.config.filesToOpen);
return TPromise.as({ files, folders }); return TPromise.as({ files, folders });
} }
......
...@@ -1150,7 +1150,7 @@ export class ClearRecentFilesAction extends Action { ...@@ -1150,7 +1150,7 @@ export class ClearRecentFilesAction extends Action {
} }
public run(): TPromise<any> { public run(): TPromise<any> {
this.windowsService.clearRecentPathsList(); this.windowsService.clearRecentlyOpened();
return TPromise.as(false); return TPromise.as(false);
} }
......
...@@ -1118,7 +1118,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro ...@@ -1118,7 +1118,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
// Add external ones to recently open list // Add external ones to recently open list
const externalResources = droppedResources.filter(d => d.isExternal).map(d => d.resource); const externalResources = droppedResources.filter(d => d.isExternal).map(d => d.resource);
if (externalResources.length) { if (externalResources.length) {
$this.windowsService.addToRecentlyOpen(externalResources.map(resource => { $this.windowsService.addToRecentlyOpened(externalResources.map(resource => {
return { return {
path: resource.fsPath, path: resource.fsPath,
isFile: true isFile: true
......
...@@ -691,7 +691,7 @@ export class TabsTitleControl extends TitleControl { ...@@ -691,7 +691,7 @@ export class TabsTitleControl extends TitleControl {
// Add external ones to recently open list // Add external ones to recently open list
const externalResources = resources.filter(d => d.isExternal).map(d => d.resource); const externalResources = resources.filter(d => d.isExternal).map(d => d.resource);
if (externalResources.length) { if (externalResources.length) {
this.windowsService.addToRecentlyOpen(externalResources.map(resource => { this.windowsService.addToRecentlyOpened(externalResources.map(resource => {
return { return {
path: resource.fsPath, path: resource.fsPath,
isFile: true isFile: true
......
...@@ -663,7 +663,7 @@ export abstract class BaseOpenRecentAction extends Action { ...@@ -663,7 +663,7 @@ export abstract class BaseOpenRecentAction extends Action {
protected abstract isQuickNavigate(): boolean; protected abstract isQuickNavigate(): boolean;
public run(): TPromise<void> { public run(): TPromise<void> {
return this.windowService.getRecentlyOpen() return this.windowService.getRecentlyOpened()
.then(({ files, folders }) => this.openRecent(files, folders)); .then(({ files, folders }) => this.openRecent(files, folders));
} }
......
...@@ -188,7 +188,7 @@ class WelcomePage { ...@@ -188,7 +188,7 @@ class WelcomePage {
} }
private create() { private create() {
const recentlyOpened = this.windowService.getRecentlyOpen(); const recentlyOpened = this.windowService.getRecentlyOpened();
const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions); const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions);
const uri = URI.parse(require.toUrl('./vs_code_welcome_page')) const uri = URI.parse(require.toUrl('./vs_code_welcome_page'))
.with({ .with({
......
...@@ -395,7 +395,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic ...@@ -395,7 +395,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
this.removeFromHistory(arg1); this.removeFromHistory(arg1);
this.removeFromStack(arg1); this.removeFromStack(arg1);
this.removeFromRecentlyClosedFiles(arg1); this.removeFromRecentlyClosedFiles(arg1);
this.removeFromRecentlyOpen(arg1); this.removeFromRecentlyOpened(arg1);
} }
private removeExcludedFromHistory(): void { private removeExcludedFromHistory(): void {
...@@ -568,14 +568,14 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic ...@@ -568,14 +568,14 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
this.recentlyClosedFiles = this.recentlyClosedFiles.filter(e => !this.matchesFile(e.resource, arg1)); this.recentlyClosedFiles = this.recentlyClosedFiles.filter(e => !this.matchesFile(e.resource, arg1));
} }
private removeFromRecentlyOpen(arg1: IEditorInput | IResourceInput | FileChangesEvent): void { private removeFromRecentlyOpened(arg1: IEditorInput | IResourceInput | FileChangesEvent): void {
if (arg1 instanceof EditorInput || arg1 instanceof FileChangesEvent) { if (arg1 instanceof EditorInput || arg1 instanceof FileChangesEvent) {
return; // for now do not delete from file events since recently open are likely out of workspace files for which there are no delete events return; // for now do not delete from file events since recently open are likely out of workspace files for which there are no delete events
} }
const input = arg1 as IResourceInput; const input = arg1 as IResourceInput;
this.windowService.removeFromRecentlyOpen([input.resource.fsPath]); this.windowService.removeFromRecentlyOpened([input.resource.fsPath]);
} }
private isFileOpened(resource: URI, group: IEditorGroup): boolean { private isFileOpened(resource: URI, group: IEditorGroup): boolean {
......
...@@ -889,7 +889,7 @@ export class TestWindowService implements IWindowService { ...@@ -889,7 +889,7 @@ export class TestWindowService implements IWindowService {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
getRecentlyOpen(): TPromise<{ files: string[]; folders: string[]; }> { getRecentlyOpened(): TPromise<{ files: string[]; folders: string[]; }> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
...@@ -1017,19 +1017,19 @@ export class TestWindowsService implements IWindowsService { ...@@ -1017,19 +1017,19 @@ export class TestWindowsService implements IWindowsService {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
addToRecentlyOpen(paths: { path: string, isFile?: boolean }[]): TPromise<void> { addToRecentlyOpened(paths: { path: string, isFile?: boolean }[]): TPromise<void> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
removeFromRecentlyOpen(paths: string[]): TPromise<void> { removeFromRecentlyOpened(paths: string[]): TPromise<void> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
clearRecentPathsList(): TPromise<void> { clearRecentlyOpened(): TPromise<void> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
getRecentlyOpen(windowId: number): TPromise<{ files: string[]; folders: string[]; }> { getRecentlyOpened(windowId: number): TPromise<{ files: string[]; folders: string[]; }> {
return TPromise.as(void 0); return TPromise.as(void 0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册