提交 77dd29d9 编写于 作者: J Johannes Rieken

add deprecation warning, #18066

上级 0658244f
......@@ -3876,14 +3876,14 @@ declare module 'vscode' {
export function setStatusBarMessage(text: string): Disposable;
/**
* @deprecated This function **deprecated**. Use `withProgress` instead.
*
* ~~Show progress in the Source Control viewlet while running the given callback and while
* its returned promise isn't resolve or rejected.~~
*
* @param task A callback returning a promise. Progress increments can be reported with
* the provided [progress](#Progress)-object.
* @return The thenable the task did rseturn.
*
* @deprecated Use `withProgress` instead.
*/
export function withScmProgress<R>(task: (progress: Progress<number>) => Thenable<R>): Thenable<R>;
......
......@@ -345,6 +345,7 @@ export function createApiFactory(
return extHostStatusBar.setStatusBarMessage(text, timeoutOrThenable);
},
withScmProgress<R>(task: (progress: vscode.Progress<number>) => Thenable<R>) {
console.warn(`[Deprecation Warning] function 'withScmProgress' is deprecated and should no longer be used. Use 'withProgress' instead.`);
return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, task);
},
withProgress<R>(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; percentage?: number }>) => Thenable<R>) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册