You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LanguageDefinition.ts uses readFileSync and existsSync from fs. The VSCode FS API for web extensions does not provide synchronous function calls: https://code.visualstudio.com/api/references/vscode-api#FileSystem. As far as I can tell from a little reading, it is not possible to implement a synchronous function out of an asynchronous function in typescript. Any function that wants to await on an asynchronous function return value must itself be async. So I think to support a web version of Cursorless we need to refactor LanguageDefinition, and all other uses of synchronous FS methods, into asynchronous code.
The text was updated successfully, but these errors were encountered:
The vscode implementation of file system have now moved to be a synchronous. As far as I can tell all async implementations of fs are in scripts, test harness or the webpage.
LanguageDefinition.ts uses readFileSync and existsSync from fs. The VSCode FS API for web extensions does not provide synchronous function calls: https://code.visualstudio.com/api/references/vscode-api#FileSystem. As far as I can tell from a little reading, it is not possible to implement a synchronous function out of an asynchronous function in typescript. Any function that wants to await on an asynchronous function return value must itself be async. So I think to support a web version of Cursorless we need to refactor LanguageDefinition, and all other uses of synchronous FS methods, into asynchronous code.
The text was updated successfully, but these errors were encountered: