MCPcopy Index your code
hub / github.com/continuedev/continue / fsOperation

Method fsOperation

extensions/vscode/src/util/ideUtils.ts:205–229  ·  view source on GitHub ↗

* Performs a file system operation on the given URI using the provided delegate function. * * @template T The type of the result returned by the delegate function. * @param uri The URI on which the file system operation is to be performed. * @param delegate A function that performs the d

(
    uri: vscode.Uri,
    delegate: (uri: vscode.Uri) => T,
    ignoreMissingProviders: boolean = true,
  )

Source from the content-addressed store, hash-verified

203 * @throws Re-throws any error encountered during the operation, except for missing provider errors when `ignoreMissingProviders` is `true`.
204 */
205 private async fsOperation<T>(
206 uri: vscode.Uri,
207 delegate: (uri: vscode.Uri) => T,
208 ignoreMissingProviders: boolean = true,
209 ): Promise<T | null> {
210 const scheme = uri.scheme;
211 if (ignoreMissingProviders && UNSUPPORTED_SCHEMES.has(scheme)) {
212 return null;
213 }
214 try {
215 return await delegate(uri);
216 } catch (err: any) {
217 if (
218 ignoreMissingProviders &&
219 //see https://github.com/microsoft/vscode/blob/c9c54f9e775e5f57d97bef796797b5bc670c8150/src/vs/workbench/api/common/extHostFileSystemConsumer.ts#L230
220 (err.name === NO_FS_PROVIDER_ERROR ||
221 err.message?.includes(NO_FS_PROVIDER_ERROR))
222 ) {
223 UNSUPPORTED_SCHEMES.add(scheme);
224 console.log(`Ignoring missing provider error:`, err.message);
225 return null;
226 }
227 throw err;
228 }
229 }
230
231 showVirtualFile(name: string, contents: string) {
232 vscode.workspace

Callers 3

readFileMethod · 0.95
statMethod · 0.95
readDirectoryMethod · 0.95

Calls 2

addMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected