MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / doWithProgress

Function doWithProgress

src/util.ts:299–312  ·  view source on GitHub ↗
(cb: (token?: vscode.CancellationToken, progress?: vscode.Progress<{ message?: string; increment?: number }>) => T | Promise<T>, location: (string | vscode.ProgressLocation) = vscode.ProgressLocation.Window, title?: string, cancellable?: boolean)

Source from the content-addressed store, hash-verified

297// synchronous callbacks are converted to async to properly render the progress bar
298// default location is in the help pages tree view
299export async function doWithProgress<T>(cb: (token?: vscode.CancellationToken, progress?: vscode.Progress<{ message?: string; increment?: number }>) => T | Promise<T>, location: (string | vscode.ProgressLocation) = vscode.ProgressLocation.Window, title?: string, cancellable?: boolean): Promise<T> {
300 const location2 = (typeof location === 'string' ? { viewId: location } : location);
301 const options: vscode.ProgressOptions = {
302 location: location2,
303 cancellable: cancellable ?? false,
304 title: title
305 };
306 return await vscode.window.withProgress(options, async (progress, token) => {
307 return await new Promise<T>((resolve) => setTimeout(() => {
308 const ret = cb(token, progress);
309 resolve(ret);
310 }));
311 });
312}
313
314// get the URL of a CRAN website
315// argument path is optional and should be relative to the cran root

Callers 3

callBackMethod · 0.90
getAllAliasesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected