parent
9e0cffd85c
commit
7a374c3d13
1 changed files with 2 additions and 1 deletions
|
@ -20,7 +20,8 @@ type AutoDetect = 'on' | 'off' | 'build' | 'watch';
|
||||||
const exists = async (resource: vscode.Uri): Promise<boolean> => {
|
const exists = async (resource: vscode.Uri): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
const stat = await vscode.workspace.fs.stat(resource);
|
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 {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue