'use strict' ; import { FileSystemError , FileType , Uri , workspace } from "vscode" ; export async function exists ( uri ) { try { await workspace . fs . stat ( uri ) ; } catch ( err ) { if ( err instanceof FileSystemError && err . code === 'FileNotFound' ) { return false ; } else { throw err ; } } return true ; } export async function doesNotExist ( uri ) { return ! ( await exists ( uri ) ) ; } export async function isDirectory ( uri ) { const stat = await workspace . fs . stat ( uri ) ; return stat . type === FileType . Directory ; } export async function isNotDirectory ( uri ) { return ! ( await isDirectory ( uri ) ) ; } export async function isFile ( uri ) { const stat = await workspace . fs . stat ( uri ) ; return stat . type === FileType . File ; }