@@ -16,7 +16,7 @@ import { getPathLabel, getBaseLabel } from 'vs/base/common/labels';
1616import { IPath } from 'vs/platform/windows/common/windows' ;
1717import { Event as CommonEvent , Emitter } from 'vs/base/common/event' ;
1818import { isWindows , isMacintosh , isLinux } from 'vs/base/common/platform' ;
19- import { IWorkspaceIdentifier , IWorkspacesMainService , getWorkspaceLabel , IWorkspaceSavedEvent , ISingleFolderWorkspaceIdentifier2 , isSingleFolderWorkspaceIdentifier2 , isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces' ;
19+ import { IWorkspaceIdentifier , IWorkspacesMainService , getWorkspaceLabel , IWorkspaceSavedEvent , ISingleFolderWorkspaceIdentifier , isSingleFolderWorkspaceIdentifier , isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces' ;
2020import { IHistoryMainService , IRecentlyOpened } from 'vs/platform/history/common/history' ;
2121import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
2222import { isEqual } from 'vs/base/common/paths' ;
@@ -65,14 +65,14 @@ export class HistoryMainService implements IHistoryMainService {
6565 this . addRecentlyOpened ( [ e . workspace ] , [ ] ) ;
6666 }
6767
68- addRecentlyOpened ( workspaces : ( IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier2 ) [ ] , files : string [ ] ) : void {
68+ addRecentlyOpened ( workspaces : ( IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier ) [ ] , files : string [ ] ) : void {
6969 if ( ( workspaces && workspaces . length > 0 ) || ( files && files . length > 0 ) ) {
7070 const mru = this . getRecentlyOpened ( ) ;
7171
7272 // Workspaces
7373 if ( Array . isArray ( workspaces ) ) {
7474 workspaces . forEach ( workspace => {
75- const isUntitledWorkspace = ! isSingleFolderWorkspaceIdentifier2 ( workspace ) && this . workspacesMainService . isUntitledWorkspace ( workspace ) ;
75+ const isUntitledWorkspace = ! isSingleFolderWorkspaceIdentifier ( workspace ) && this . workspacesMainService . isUntitledWorkspace ( workspace ) ;
7676 if ( isUntitledWorkspace ) {
7777 return ; // only store saved workspaces
7878 }
@@ -112,7 +112,7 @@ export class HistoryMainService implements IHistoryMainService {
112112 }
113113 }
114114
115- removeFromRecentlyOpened ( pathsToRemove : ( IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier2 | string ) [ ] ) : void {
115+ removeFromRecentlyOpened ( pathsToRemove : ( IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | string ) [ ] ) : void {
116116 const mru = this . getRecentlyOpened ( ) ;
117117 let update = false ;
118118
@@ -123,11 +123,11 @@ export class HistoryMainService implements IHistoryMainService {
123123 if ( isWorkspaceIdentifier ( pathToRemove ) ) {
124124 return isWorkspaceIdentifier ( workspace ) && isEqual ( pathToRemove . configPath , workspace . configPath , ! isLinux /* ignorecase */ ) ;
125125 }
126- if ( isSingleFolderWorkspaceIdentifier2 ( pathToRemove ) ) {
127- return isSingleFolderWorkspaceIdentifier2 ( workspace ) && areResourcesEqual ( pathToRemove , workspace , hasToIgnoreCase ( pathToRemove ) ) ;
126+ if ( isSingleFolderWorkspaceIdentifier ( pathToRemove ) ) {
127+ return isSingleFolderWorkspaceIdentifier ( workspace ) && areResourcesEqual ( pathToRemove , workspace , hasToIgnoreCase ( pathToRemove ) ) ;
128128 }
129129 if ( typeof pathsToRemove === 'string' ) {
130- if ( isSingleFolderWorkspaceIdentifier2 ( workspace ) ) {
130+ if ( isSingleFolderWorkspaceIdentifier ( workspace ) ) {
131131 return workspace . scheme === Schemas . file && areResourcesEqual ( URI . file ( pathToRemove ) , workspace , hasToIgnoreCase ( workspace ) ) ;
132132 }
133133 if ( isWorkspaceIdentifier ( workspace ) ) {
@@ -179,7 +179,7 @@ export class HistoryMainService implements IHistoryMainService {
179179 // Take up to maxEntries/2 workspaces
180180 for ( let i = 0 ; i < mru . workspaces . length && i < HistoryMainService . MAX_MACOS_DOCK_RECENT_ENTRIES / 2 ; i ++ ) {
181181 const workspace = mru . workspaces [ i ] ;
182- app . addRecentDocument ( isSingleFolderWorkspaceIdentifier2 ( workspace ) ? workspace . scheme === Schemas . file ? workspace . fsPath : workspace . toString ( ) : workspace . configPath ) ;
182+ app . addRecentDocument ( isSingleFolderWorkspaceIdentifier ( workspace ) ? workspace . scheme === Schemas . file ? workspace . fsPath : workspace . toString ( ) : workspace . configPath ) ;
183183 maxEntries -- ;
184184 }
185185
@@ -198,8 +198,8 @@ export class HistoryMainService implements IHistoryMainService {
198198 this . _onRecentlyOpenedChange . fire ( ) ;
199199 }
200200
201- getRecentlyOpened ( currentWorkspace ?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier2 , currentFiles ?: IPath [ ] ) : IRecentlyOpened {
202- let workspaces : ( IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier2 ) [ ] ;
201+ getRecentlyOpened ( currentWorkspace ?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier , currentFiles ?: IPath [ ] ) : IRecentlyOpened {
202+ let workspaces : ( IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier ) [ ] ;
203203 let files : string [ ] ;
204204
205205 // Get from storage
@@ -227,13 +227,13 @@ export class HistoryMainService implements IHistoryMainService {
227227 files = arrays . distinct ( files , file => this . distinctFn ( file ) ) ;
228228
229229 // Hide untitled workspaces
230- workspaces = workspaces . filter ( workspace => isSingleFolderWorkspaceIdentifier2 ( workspace ) || ! this . workspacesMainService . isUntitledWorkspace ( workspace ) ) ;
230+ workspaces = workspaces . filter ( workspace => isSingleFolderWorkspaceIdentifier ( workspace ) || ! this . workspacesMainService . isUntitledWorkspace ( workspace ) ) ;
231231
232232 return { workspaces, files } ;
233233 }
234234
235- private distinctFn ( workspaceOrFile : IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier2 | string ) : string {
236- if ( isSingleFolderWorkspaceIdentifier2 ( workspaceOrFile ) ) {
235+ private distinctFn ( workspaceOrFile : IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | string ) : string {
236+ if ( isSingleFolderWorkspaceIdentifier ( workspaceOrFile ) ) {
237237 return getComparisonKey ( workspaceOrFile ) ;
238238 }
239239 if ( typeof workspaceOrFile === 'string' ) {
@@ -261,7 +261,7 @@ export class HistoryMainService implements IHistoryMainService {
261261 private saveRecentlyOpened ( recent : IRecentlyOpened ) : void {
262262 const serialized : ISerializedRecentlyOpened = { workspaces : [ ] , files : recent . files } ;
263263 for ( const workspace of recent . workspaces ) {
264- if ( isSingleFolderWorkspaceIdentifier2 ( workspace ) ) {
264+ if ( isSingleFolderWorkspaceIdentifier ( workspace ) ) {
265265 serialized . workspaces . push ( < UriComponents > workspace . toJSON ( ) ) ;
266266 } else {
267267 serialized . workspaces . push ( workspace ) ;
@@ -308,10 +308,10 @@ export class HistoryMainService implements IHistoryMainService {
308308 name : nls . localize ( 'recentFolders' , "Recent Workspaces" ) ,
309309 items : this . getRecentlyOpened ( ) . workspaces . slice ( 0 , 7 /* limit number of entries here */ ) . map ( workspace => {
310310 const title = getWorkspaceLabel ( workspace , this . environmentService ) ;
311- const description = isSingleFolderWorkspaceIdentifier2 ( workspace ) ? nls . localize ( 'folderDesc' , "{0} {1}" , getBaseLabel ( workspace ) , getPathLabel ( path . dirname ( workspace . path ) , this . environmentService ) ) : nls . localize ( 'codeWorkspace' , "Code Workspace" ) ;
311+ const description = isSingleFolderWorkspaceIdentifier ( workspace ) ? nls . localize ( 'folderDesc' , "{0} {1}" , getBaseLabel ( workspace ) , getPathLabel ( path . dirname ( workspace . path ) , this . environmentService ) ) : nls . localize ( 'codeWorkspace' , "Code Workspace" ) ;
312312 let args ;
313313 // use quotes to support paths with whitespaces
314- if ( isSingleFolderWorkspaceIdentifier2 ( workspace ) ) {
314+ if ( isSingleFolderWorkspaceIdentifier ( workspace ) ) {
315315 if ( workspace . scheme === Schemas . file ) {
316316 args = `"${ workspace . fsPath } "` ;
317317 } else {
0 commit comments