mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 1df23554b2e3d5f1efc6fbc76ee61d3f7f186c6d
This commit is contained in:
@@ -543,6 +543,9 @@ 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 (options.location === extHostTypes.ProgressLocation.View) {
|
||||
checkProposedApiEnabled(extension);
|
||||
}
|
||||
return extHostProgress.withProgress(extension, options, task);
|
||||
},
|
||||
createOutputChannel(name: string): vscode.OutputChannel {
|
||||
|
||||
@@ -24,9 +24,10 @@ export class ExtHostProgress implements ExtHostProgressShape {
|
||||
|
||||
withProgress<R>(extension: IExtensionDescription, options: ProgressOptions, task: (progress: Progress<IProgressStep>, token: CancellationToken) => Thenable<R>): Thenable<R> {
|
||||
const handle = this._handles++;
|
||||
const { title, location, cancellable } = options;
|
||||
const { title, location, cancellable, viewId } = options;
|
||||
const source = localize('extensionSource', "{0} (Extension)", extension.displayName || extension.name);
|
||||
this._proxy.$startProgress(handle, { location: ProgressLocation.from(location), title, source, cancellable }, extension);
|
||||
|
||||
this._proxy.$startProgress(handle, { location: ProgressLocation.from(location, viewId), title, source, cancellable }, extension);
|
||||
return this._withProgress(handle, task, !!cancellable);
|
||||
}
|
||||
|
||||
|
||||
@@ -1093,11 +1093,12 @@ export namespace EndOfLine {
|
||||
}
|
||||
|
||||
export namespace ProgressLocation {
|
||||
export function from(loc: vscode.ProgressLocation): MainProgressLocation {
|
||||
export function from(loc: vscode.ProgressLocation, viewId?: string): MainProgressLocation | string {
|
||||
switch (loc) {
|
||||
case types.ProgressLocation.SourceControl: return MainProgressLocation.Scm;
|
||||
case types.ProgressLocation.Window: return MainProgressLocation.Window;
|
||||
case types.ProgressLocation.Notification: return MainProgressLocation.Notification;
|
||||
case types.ProgressLocation.View: return viewId ?? '';
|
||||
}
|
||||
throw new Error(`Unknown 'ProgressLocation'`);
|
||||
}
|
||||
|
||||
@@ -2082,7 +2082,8 @@ export class Task implements vscode.Task2 {
|
||||
export enum ProgressLocation {
|
||||
SourceControl = 1,
|
||||
Window = 10,
|
||||
Notification = 15
|
||||
Notification = 15,
|
||||
View = 25
|
||||
}
|
||||
|
||||
@es5ClassCompat
|
||||
@@ -2333,12 +2334,12 @@ export class FileSystemError extends Error {
|
||||
return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.Unavailable, FileSystemError.Unavailable);
|
||||
}
|
||||
|
||||
readonly code?: string;
|
||||
readonly code: string;
|
||||
|
||||
constructor(uriOrMessage?: string | URI, code: FileSystemProviderErrorCode = FileSystemProviderErrorCode.Unknown, terminator?: Function) {
|
||||
super(URI.isUri(uriOrMessage) ? uriOrMessage.toString(true) : uriOrMessage);
|
||||
|
||||
this.code = terminator?.name;
|
||||
this.code = terminator?.name ?? 'Unknown';
|
||||
|
||||
// mark the error as file system provider error so that
|
||||
// we can extract the error code on the receiving side
|
||||
|
||||
Reference in New Issue
Block a user