提交 8fe74b82 编写于 作者: E Eric Amodio

Fixes bad type check

上级 2e1e4849
......@@ -540,7 +540,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, (progress, token) => task({ report(n: number) { /*noop*/ } }));
},
withProgress<R>(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; worked?: number }>, token: vscode.CancellationToken) => Thenable<R>) {
if (typeof options.location !== 'number') {
if (typeof options.location === 'object') {
checkProposedApiEnabled(extension);
}
return extHostProgress.withProgress(extension, options, task);
......
......@@ -1094,8 +1094,8 @@ export namespace EndOfLine {
export namespace ProgressLocation {
export function from(loc: vscode.ProgressLocation | { viewId: string }): MainProgressLocation | string {
if (typeof loc === 'string') {
return loc;
if (typeof loc === 'object') {
return loc.viewId;
}
switch (loc) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册