constresolvedWorkspace=this.workspacesMainService.resolveLocalWorkspaceSync(workspace.configPath);// workspace folders can only be shown for local (resolved) workspaces
// Local: produce a hash from the path and include creation time as salt
if(!folderStat){
try{
folderStat=statSync(folderUri.fsPath);
}catch(error){
returnundefined;// folder does not exist
}
}
letctime:number|undefined;
if(isLinux){
ctime=folderStat.ino;// Linux: birthtime is ctime, so we cannot use it! We use the ino instead!
}elseif(isMacintosh){
ctime=folderStat.birthtime.getTime();// macOS: birthtime is fine to use as is
}elseif(isWindows){
if(typeoffolderStat.birthtimeMs==='number'){
ctime=Math.floor(folderStat.birthtimeMs);// Windows: fix precision issue in node.js 8.x to get 7.x results (see https://github.com/nodejs/node/issues/19897)
}else{
ctime=folderStat.birthtime.getTime();
}
}
// we use the ctime as extra salt to the ID so that we catch the case of a folder getting
// deleted and recreated. in that case we do not want to carry over previous state
ctime=fileStat.ino;// Linux: birthtime is ctime, so we cannot use it! We use the ino instead!
}elseif(isMacintosh){
ctime=fileStat.birthtime.getTime();// macOS: birthtime is fine to use as is
}elseif(isWindows){
if(typeoffileStat.birthtimeMs==='number'){
ctime=Math.floor(fileStat.birthtimeMs);// Windows: fix precision issue in node.js 8.x to get 7.x results (see https://github.com/nodejs/node/issues/19897)
}else{
ctime=fileStat.birthtime.getTime();
}
}
// we use the ctime as extra salt to the ID so that we catch the case of a folder getting
// deleted and recreated. in that case we do not want to carry over previous state