@@ -14,21 +14,21 @@ import { Event as CommonEvent, Emitter } from 'vs/base/common/event';
1414import { isWindows , isMacintosh } from 'vs/base/common/platform' ;
1515import { IWorkspaceIdentifier , ISingleFolderWorkspaceIdentifier , isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces' ;
1616import { IWorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService' ;
17- import { IRecentlyOpened , isRecentWorkspace , isRecentFolder , IRecent , isRecentFile , IRecentFolder , IRecentWorkspace , IRecentFile } from 'vs/platform/history /common/history ' ;
17+ import { IRecentlyOpened , isRecentWorkspace , isRecentFolder , IRecent , isRecentFile , IRecentFolder , IRecentWorkspace , IRecentFile } from 'vs/platform/workspaces /common/workspacesHistory ' ;
1818import { ThrottledDelayer } from 'vs/base/common/async' ;
1919import { isEqual as areResourcesEqual , dirname , originalFSPath , basename } from 'vs/base/common/resources' ;
2020import { URI } from 'vs/base/common/uri' ;
2121import { Schemas } from 'vs/base/common/network' ;
2222import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
2323import { getSimpleWorkspaceLabel } from 'vs/platform/label/common/label' ;
24- import { toStoreData , restoreRecentlyOpened , RecentlyOpenedStorageData } from 'vs/platform/history /common/historyStorage ' ;
24+ import { toStoreData , restoreRecentlyOpened , RecentlyOpenedStorageData } from 'vs/platform/workspaces /common/workspacesHistoryStorage ' ;
2525import { exists } from 'vs/base/node/pfs' ;
2626import { ILifecycleMainService , LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService' ;
2727import { createDecorator } from 'vs/platform/instantiation/common/instantiation' ;
2828
29- export const IHistoryMainService = createDecorator < IHistoryMainService > ( 'historyMainService ' ) ;
29+ export const IWorkspacesHistoryMainService = createDecorator < IWorkspacesHistoryMainService > ( 'workspacesHistoryMainService ' ) ;
3030
31- export interface IHistoryMainService {
31+ export interface IWorkspacesHistoryMainService {
3232
3333 _serviceBrand : undefined ;
3434
@@ -42,7 +42,7 @@ export interface IHistoryMainService {
4242 updateWindowsJumpList ( ) : void ;
4343}
4444
45- export class HistoryMainService implements IHistoryMainService {
45+ export class WorkspacesHistoryMainService implements IWorkspacesHistoryMainService {
4646
4747 private static readonly MAX_TOTAL_RECENT_ENTRIES = 100 ;
4848
@@ -108,7 +108,7 @@ export class HistoryMainService implements IHistoryMainService {
108108 // File
109109 else {
110110 const alreadyExistsInHistory = indexOfFile ( files , curr . fileUri ) >= 0 ;
111- const shouldBeFiltered = curr . fileUri . scheme === Schemas . file && HistoryMainService . COMMON_FILES_FILTER . indexOf ( basename ( curr . fileUri ) ) >= 0 ;
111+ const shouldBeFiltered = curr . fileUri . scheme === Schemas . file && WorkspacesHistoryMainService . COMMON_FILES_FILTER . indexOf ( basename ( curr . fileUri ) ) >= 0 ;
112112
113113 if ( ! alreadyExistsInHistory && ! shouldBeFiltered ) {
114114 files . push ( curr ) ;
@@ -123,12 +123,12 @@ export class HistoryMainService implements IHistoryMainService {
123123
124124 this . addEntriesFromStorage ( workspaces , files ) ;
125125
126- if ( workspaces . length > HistoryMainService . MAX_TOTAL_RECENT_ENTRIES ) {
127- workspaces . length = HistoryMainService . MAX_TOTAL_RECENT_ENTRIES ;
126+ if ( workspaces . length > WorkspacesHistoryMainService . MAX_TOTAL_RECENT_ENTRIES ) {
127+ workspaces . length = WorkspacesHistoryMainService . MAX_TOTAL_RECENT_ENTRIES ;
128128 }
129129
130- if ( files . length > HistoryMainService . MAX_TOTAL_RECENT_ENTRIES ) {
131- files . length = HistoryMainService . MAX_TOTAL_RECENT_ENTRIES ;
130+ if ( files . length > WorkspacesHistoryMainService . MAX_TOTAL_RECENT_ENTRIES ) {
131+ files . length = WorkspacesHistoryMainService . MAX_TOTAL_RECENT_ENTRIES ;
132132 }
133133
134134 this . saveRecentlyOpened ( { workspaces, files } ) ;
@@ -180,7 +180,7 @@ export class HistoryMainService implements IHistoryMainService {
180180 // Collect max-N recent workspaces that are known to exist
181181 const workspaceEntries : string [ ] = [ ] ;
182182 let entries = 0 ;
183- for ( let i = 0 ; i < mru . workspaces . length && entries < HistoryMainService . MAX_MACOS_DOCK_RECENT_WORKSPACES ; i ++ ) {
183+ for ( let i = 0 ; i < mru . workspaces . length && entries < WorkspacesHistoryMainService . MAX_MACOS_DOCK_RECENT_WORKSPACES ; i ++ ) {
184184 const loc = location ( mru . workspaces [ i ] ) ;
185185 if ( loc . scheme === Schemas . file ) {
186186 const workspacePath = originalFSPath ( loc ) ;
@@ -193,12 +193,12 @@ export class HistoryMainService implements IHistoryMainService {
193193
194194 // Collect max-N recent files that are known to exist
195195 const fileEntries : string [ ] = [ ] ;
196- for ( let i = 0 ; i < mru . files . length && entries < HistoryMainService . MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL ; i ++ ) {
196+ for ( let i = 0 ; i < mru . files . length && entries < WorkspacesHistoryMainService . MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL ; i ++ ) {
197197 const loc = location ( mru . files [ i ] ) ;
198198 if ( loc . scheme === Schemas . file ) {
199199 const filePath = originalFSPath ( loc ) ;
200200 if (
201- HistoryMainService . COMMON_FILES_FILTER . indexOf ( basename ( loc ) ) !== - 1 || // skip some well known file entries
201+ WorkspacesHistoryMainService . COMMON_FILES_FILTER . indexOf ( basename ( loc ) ) !== - 1 || // skip some well known file entries
202202 workspaceEntries . indexOf ( filePath ) !== - 1 // prefer a workspace entry over a file entry (e.g. for .code-workspace)
203203 ) {
204204 continue ;
@@ -285,15 +285,15 @@ export class HistoryMainService implements IHistoryMainService {
285285 }
286286
287287 private getRecentlyOpenedFromStorage ( ) : IRecentlyOpened {
288- const storedRecents = this . stateService . getItem < RecentlyOpenedStorageData > ( HistoryMainService . recentlyOpenedStorageKey ) ;
288+ const storedRecents = this . stateService . getItem < RecentlyOpenedStorageData > ( WorkspacesHistoryMainService . recentlyOpenedStorageKey ) ;
289289
290290 return restoreRecentlyOpened ( storedRecents , this . logService ) ;
291291 }
292292
293293 private saveRecentlyOpened ( recent : IRecentlyOpened ) : void {
294294 const serialized = toStoreData ( recent ) ;
295295
296- this . stateService . setItem ( HistoryMainService . recentlyOpenedStorageKey , serialized ) ;
296+ this . stateService . setItem ( WorkspacesHistoryMainService . recentlyOpenedStorageKey , serialized ) ;
297297 }
298298
299299 updateWindowsJumpList ( ) : void {
0 commit comments