Handle stat.type correctly in typescript features extension

#85753
This commit is contained in:
Alex Ross 2019-12-17 11:58:28 +00:00
parent 9e0cffd85c
commit 7a374c3d13

View file

@ -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;
}