File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { type FSWatcher, watch as watchSync } from 'node:fs';
22import { readFile , rename , stat , unlink } from 'node:fs/promises' ;
33import * as vscode from 'vscode' ;
44import { osacompileFromSource , osadecompile } from '../osa.ts' ;
5- import { scptUriToFileUri } from '../util.ts' ;
5+ import { fileExists , scptUriToFileUri } from '../util.ts' ;
66
77/**
88 * Virtual FileSystemProvider for binary AppleScript (.scpt) files
@@ -111,10 +111,7 @@ export class ScptFileSystemProvider implements vscode.FileSystemProvider {
111111 const filePath = fileUri . fsPath ;
112112
113113 try {
114- // Check if file exists
115- const exists = await stat ( filePath )
116- . then ( ( ) => true )
117- . catch ( ( ) => false ) ;
114+ const exists = await fileExists ( filePath ) ;
118115
119116 if ( ! exists && ! options . create ) {
120117 throw vscode . FileSystemError . FileNotFound ( uri ) ;
You can’t perform that action at this time.
0 commit comments