mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
@@ -20,7 +20,8 @@ type AutoDetect = 'on' | 'off' | 'build' | 'watch';
|
||||
const exists = async (resource: vscode.Uri): Promise<boolean> => {
|
||||
try {
|
||||
const stat = await vscode.workspace.fs.stat(resource);
|
||||
return stat.type === vscode.FileType.File;
|
||||
// stat.type is an enum flag
|
||||
return !!(stat.type & vscode.FileType.File);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user