@@ -22,15 +22,15 @@ import { EventService } from 'vs/platform/event/common/eventService';
2222import { IWorkspace , WorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
2323import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService' ;
2424import { ParsedArgs } from 'vs/platform/environment/common/environment' ;
25- import { realpath } from 'vs/base/node/pfs' ;
25+ import { realpath , stat } from 'vs/base/node/pfs' ;
2626import { EnvironmentService } from 'vs/platform/environment/node/environmentService' ;
2727import path = require( 'path' ) ;
28- import fs = require( 'fs' ) ;
2928import gracefulFs = require( 'graceful-fs' ) ;
3029import { IPath , IOpenFileRequest } from 'vs/workbench/electron-browser/common' ;
3130
3231import { webFrame } from 'electron' ;
3332
33+ import fs = require( 'fs' ) ;
3434gracefulFs . gracefulify ( fs ) ; // enable gracefulFs
3535
3636const timers = ( < any > window ) . MonacoEnvironment . timers ;
@@ -116,13 +116,14 @@ function getWorkspace(workspacePath: string): TPromise<IWorkspace> {
116116
117117 const workspaceResource = uri . file ( realWorkspacePath ) ;
118118 const folderName = path . basename ( realWorkspacePath ) || realWorkspacePath ;
119- const folderStat = fs . statSync ( realWorkspacePath ) ;
120119
121- return < IWorkspace > {
122- 'resource' : workspaceResource ,
123- 'name' : folderName ,
124- 'uid' : platform . isLinux ? folderStat . ino : folderStat . birthtime . getTime ( ) // On Linux, birthtime is ctime, so we cannot use it! We use the ino instead!
125- } ;
120+ return stat ( realWorkspacePath ) . then ( folderStat => {
121+ return < IWorkspace > {
122+ 'resource' : workspaceResource ,
123+ 'name' : folderName ,
124+ 'uid' : platform . isLinux ? folderStat . ino : folderStat . birthtime . getTime ( ) // On Linux, birthtime is ctime, so we cannot use it! We use the ino instead!
125+ } ;
126+ } ) ;
126127 } , ( error ) => {
127128 errors . onUnexpectedError ( error ) ;
128129
0 commit comments