Skip to content

Commit

Permalink
Handle stat.type correctly in typescript features extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 committed Dec 17, 2019
1 parent 9e0cffd commit 7a374c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/typescript-language-features/src/features/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7a374c3

Please sign in to comment.