diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index 63a3e7bf194da..a802f11c3150c 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -46,7 +46,9 @@ "workspaceTrust", "telemetry", "windowActivity", - "interactiveUserActions" + "interactiveUserActions", + "envCollectionWorkspace", + "envCollectionOptions" ], "private": true, "activationEvents": [], diff --git a/src/vs/workbench/api/common/extHostTerminalService.ts b/src/vs/workbench/api/common/extHostTerminalService.ts index d20f3a89f6726..40b5a41ee4b86 100644 --- a/src/vs/workbench/api/common/extHostTerminalService.ts +++ b/src/vs/workbench/api/common/extHostTerminalService.ts @@ -25,7 +25,7 @@ import { withNullAsUndefined } from 'vs/base/common/types'; import { Promises } from 'vs/base/common/async'; import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; import { ViewColumn } from 'vs/workbench/api/common/extHostTypeConverters'; -import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; export interface IExtHostTerminalService extends ExtHostTerminalServiceShape, IDisposable { @@ -898,6 +898,10 @@ class UnifiedEnvironmentVariableCollection { } getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): IEnvironmentVariableCollection { + if (this._extension && scope) { + // TODO: This should be removed when the env var extension API(s) are stabilized + checkProposedApiEnabled(this._extension, 'envCollectionWorkspace'); + } const scopedCollectionKey = this.getScopeKey(scope); let scopedCollection = this.scopedCollections.get(scopedCollectionKey); if (!scopedCollection) { @@ -910,21 +914,21 @@ class UnifiedEnvironmentVariableCollection { replace(variable: string, value: string, options: vscode.EnvironmentVariableMutatorOptions | undefined, scope: vscode.EnvironmentVariableScope | undefined): void { if (this._extension && options) { - isProposedApiEnabled(this._extension, 'envCollectionOptions'); + checkProposedApiEnabled(this._extension, 'envCollectionOptions'); } this._setIfDiffers(variable, { value, type: EnvironmentVariableMutatorType.Replace, options: options ?? {}, scope }); } append(variable: string, value: string, options: vscode.EnvironmentVariableMutatorOptions | undefined, scope: vscode.EnvironmentVariableScope | undefined): void { if (this._extension && options) { - isProposedApiEnabled(this._extension, 'envCollectionOptions'); + checkProposedApiEnabled(this._extension, 'envCollectionOptions'); } this._setIfDiffers(variable, { value, type: EnvironmentVariableMutatorType.Append, options: options ?? {}, scope }); } prepend(variable: string, value: string, options: vscode.EnvironmentVariableMutatorOptions | undefined, scope: vscode.EnvironmentVariableScope | undefined): void { if (this._extension && options) { - isProposedApiEnabled(this._extension, 'envCollectionOptions'); + checkProposedApiEnabled(this._extension, 'envCollectionOptions'); } this._setIfDiffers(variable, { value, type: EnvironmentVariableMutatorType.Prepend, options: options ?? {}, scope }); }