extensions/typescript-language-features/src/utils/fs.ts/exists
export const exists = async (resource: vscode.Uri): Promise<boolean> => {
	try {
		const stat = await vscode.workspace.fs.stat(resource);
		// stat.type is an enum flag
		return !!(stat.type & vscode.FileType.File);
	} catch {
		return false;
	}
};