adopt checkProposedApiEnabled

//cc @joaomoreno
This commit is contained in:
Benjamin Pasero 2020-11-27 10:42:38 +01:00
parent 14d59bef92
commit 44ddde116f

View file

@ -17,6 +17,7 @@ import { ISplice } from 'vs/base/common/sequence';
import { ILogService } from 'vs/platform/log/common/log';
import { CancellationToken } from 'vs/base/common/cancellation';
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
type ProviderHandle = number;
type GroupHandle = number;
@ -221,17 +222,13 @@ export class ExtHostSCMInputBox implements vscode.SourceControlInputBox {
private _validateInput: IValidateInput | undefined;
get validateInput(): IValidateInput | undefined {
if (!this._extension.enableProposedApi) {
throw new Error(`[${this._extension.identifier.value}]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`);
}
checkProposedApiEnabled(this._extension);
return this._validateInput;
}
set validateInput(fn: IValidateInput | undefined) {
if (!this._extension.enableProposedApi) {
throw new Error(`[${this._extension.identifier.value}]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`);
}
checkProposedApiEnabled(this._extension);
if (fn && typeof fn !== 'function') {
throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);