mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
parent
8a150ecc16
commit
1461c7d382
|
@ -52,8 +52,7 @@
|
|||
"telemetry",
|
||||
"windowActivity",
|
||||
"interactiveUserActions",
|
||||
"envCollectionWorkspace",
|
||||
"envCollectionOptions"
|
||||
"envCollectionWorkspace"
|
||||
],
|
||||
"private": true,
|
||||
"activationEvents": [],
|
||||
|
|
|
@ -944,23 +944,14 @@ class UnifiedEnvironmentVariableCollection {
|
|||
}
|
||||
|
||||
replace(variable: string, value: string, options: vscode.EnvironmentVariableMutatorOptions | undefined, scope: vscode.EnvironmentVariableScope | undefined): void {
|
||||
if (this._extension && options) {
|
||||
checkProposedApiEnabled(this._extension, 'envCollectionOptions');
|
||||
}
|
||||
this._setIfDiffers(variable, { value, type: EnvironmentVariableMutatorType.Replace, options: options ?? { applyAtProcessCreation: true }, scope });
|
||||
}
|
||||
|
||||
append(variable: string, value: string, options: vscode.EnvironmentVariableMutatorOptions | undefined, scope: vscode.EnvironmentVariableScope | undefined): void {
|
||||
if (this._extension && options) {
|
||||
checkProposedApiEnabled(this._extension, 'envCollectionOptions');
|
||||
}
|
||||
this._setIfDiffers(variable, { value, type: EnvironmentVariableMutatorType.Append, options: options ?? { applyAtProcessCreation: true }, scope });
|
||||
}
|
||||
|
||||
prepend(variable: string, value: string, options: vscode.EnvironmentVariableMutatorOptions | undefined, scope: vscode.EnvironmentVariableScope | undefined): void {
|
||||
if (this._extension && options) {
|
||||
checkProposedApiEnabled(this._extension, 'envCollectionOptions');
|
||||
}
|
||||
this._setIfDiffers(variable, { value, type: EnvironmentVariableMutatorType.Prepend, options: options ?? { applyAtProcessCreation: true }, scope });
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ export const allApiProposals = Object.freeze({
|
|||
dropMetadata: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.dropMetadata.d.ts',
|
||||
editSessionIdentityProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts',
|
||||
editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts',
|
||||
envCollectionOptions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envCollectionOptions.d.ts',
|
||||
envCollectionWorkspace: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envCollectionWorkspace.d.ts',
|
||||
envShellEvent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envShellEvent.d.ts',
|
||||
extensionRuntime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts',
|
||||
|
|
33
src/vscode-dts/vscode.d.ts
vendored
33
src/vscode-dts/vscode.d.ts
vendored
|
@ -11334,6 +11334,22 @@ declare module 'vscode' {
|
|||
Prepend = 3
|
||||
}
|
||||
|
||||
/**
|
||||
* Options applied to the mutator.
|
||||
*/
|
||||
export interface EnvironmentVariableMutatorOptions {
|
||||
/**
|
||||
* Apply to the environment just before the process is created.
|
||||
*/
|
||||
applyAtProcessCreation?: boolean;
|
||||
|
||||
/**
|
||||
* Apply to the environment in the shell integration script. Note that this _will not_ apply
|
||||
* the mutator if shell integration is disabled or not working for some reason.
|
||||
*/
|
||||
applyAtShellIntegration?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A type of mutation and its value to be applied to an environment variable.
|
||||
*/
|
||||
|
@ -11347,6 +11363,11 @@ declare module 'vscode' {
|
|||
* The value to use for the variable.
|
||||
*/
|
||||
readonly value: string;
|
||||
|
||||
/**
|
||||
* Options applied to the mutator.
|
||||
*/
|
||||
readonly options: EnvironmentVariableMutatorOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11376,8 +11397,10 @@ declare module 'vscode' {
|
|||
*
|
||||
* @param variable The variable to replace.
|
||||
* @param value The value to replace the variable with.
|
||||
* @param options Options applied to the mutator, when no options are provided this will
|
||||
* default to `{ applyAtProcessCreation: true }`.
|
||||
*/
|
||||
replace(variable: string, value: string): void;
|
||||
replace(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;
|
||||
|
||||
/**
|
||||
* Append a value to an environment variable.
|
||||
|
@ -11387,8 +11410,10 @@ declare module 'vscode' {
|
|||
*
|
||||
* @param variable The variable to append to.
|
||||
* @param value The value to append to the variable.
|
||||
* @param options Options applied to the mutator, when no options are provided this will
|
||||
* default to `{ applyAtProcessCreation: true }`.
|
||||
*/
|
||||
append(variable: string, value: string): void;
|
||||
append(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;
|
||||
|
||||
/**
|
||||
* Prepend a value to an environment variable.
|
||||
|
@ -11398,8 +11423,10 @@ declare module 'vscode' {
|
|||
*
|
||||
* @param variable The variable to prepend.
|
||||
* @param value The value to prepend to the variable.
|
||||
* @param options Options applied to the mutator, when no options are provided this will
|
||||
* default to `{ applyAtProcessCreation: true }`.
|
||||
*/
|
||||
prepend(variable: string, value: string): void;
|
||||
prepend(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;
|
||||
|
||||
/**
|
||||
* Gets the mutator that this collection applies to a variable, if any.
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/179476
|
||||
|
||||
/**
|
||||
* Options applied to the mutator.
|
||||
*/
|
||||
export interface EnvironmentVariableMutatorOptions {
|
||||
/**
|
||||
* Apply to the environment just before the process is created.
|
||||
*/
|
||||
applyAtProcessCreation?: boolean;
|
||||
|
||||
/**
|
||||
* Apply to the environment in the shell integration script. Note that this _will not_ apply
|
||||
* the mutator if shell integration is disabled or not working for some reason.
|
||||
*/
|
||||
applyAtShellIntegration?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A type of mutation and its value to be applied to an environment variable.
|
||||
*/
|
||||
export interface EnvironmentVariableMutator {
|
||||
/**
|
||||
* Options applied to the mutator.
|
||||
*/
|
||||
readonly options: EnvironmentVariableMutatorOptions;
|
||||
}
|
||||
|
||||
export interface EnvironmentVariableCollection extends Iterable<[variable: string, mutator: EnvironmentVariableMutator]> {
|
||||
/**
|
||||
* @param options Options applied to the mutator, when not options are provided this will
|
||||
* default to `{ applyAtProcessCreation: true }`
|
||||
*/
|
||||
replace(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;
|
||||
|
||||
/**
|
||||
* @param options Options applied to the mutator, when not options are provided this will
|
||||
* default to `{ applyAtProcessCreation: true }`
|
||||
*/
|
||||
append(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;
|
||||
|
||||
/**
|
||||
* @param options Options applied to the mutator, when not options are provided this will
|
||||
* default to `{ applyAtProcessCreation: true }`
|
||||
*/
|
||||
prepend(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue