Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
for (const workspace of workspaces) {
const uri = new URI(workspace);
const stat = await this.fileSystem.getFileStat(workspace);
if (!stat ||
!this.preferences['workspace.supportMultiRootWorkspace'] && !stat.isDirectory) {
continue; // skip the workspace files if multi root is not supported
}
if (tempWorkspaceFile && uri.toString() === tempWorkspaceFile.toString()) {
continue; // skip the temporary workspace files
}
const icon = this.labelProvider.getIcon(stat);
const iconClass = icon === '' ? undefined : icon + ' file-icon';
this.items.push(new QuickOpenGroupItem({
label: uri.path.base,
description: (home) ? FileSystemUtils.tildifyPath(uri.path.toString(), home) : uri.path.toString(),
groupLabel: `last modified ${moment(stat.lastModification).fromNow()}`,
iconClass,
run: (mode: QuickOpenMode): boolean => {
if (mode !== QuickOpenMode.OPEN) {
return false;
}
const current = this.workspaceService.workspace;
const uriToOpen = new URI(workspace);
if ((current && current.uri !== workspace) || !current) {
this.workspaceService.open(uriToOpen);
}
return true;
},
}));
}