Value-object describing what options formatting should use.

Fields

replace(variable:String, value:String):Void

Replace an environment variable with a value.

Note that an extension can only make a single change to any one variable, so this will overwrite any previous calls to replace, append or prepend.

Parameters:

variable

The variable to replace.

value

The value to replace the variable with.

options

Options applied to the mutator, when no options are provided this will default to { applyAtProcessCreation: true }.

prepend(variable:String, value:String):Void

Prepend a value to an environment variable.

Note that an extension can only make a single change to any one variable, so this will overwrite any previous calls to replace, append or prepend.

Parameters:

variable

The variable to prepend.

value

The value to prepend to the variable.

options

Options applied to the mutator, when no options are provided this will default to { applyAtProcessCreation: true }.

persistent:Bool

Whether the collection should be cached for the workspace and applied to the terminal across window reloads. When true the collection will be active immediately such when the window reloads. Additionally, this API will return the cached version if it exists. The collection will be invalidated when the extension is uninstalled or when the collection is cleared. Defaults to true.

getScoped(scope:EnvironmentVariableScope):EnvironmentVariableCollection

Gets scope-specific environment variable collection for the extension. This enables alterations to terminal environment variables solely within the designated scope, and is applied in addition to (and after) the global collection.

Each object obtained through this method is isolated and does not impact objects for other scopes, including the global collection.

Parameters:

scope

The scope to which the environment variable collection applies to. If a scope parameter is omitted, collection applicable to all relevant scopes for that parameter is returned. For instance, if the 'workspaceFolder' parameter is not specified, the collection that applies across all workspace folders will be returned.

Returns:

Environment variable collection for the passed in scope.

get(variable:String):Null<EnvironmentVariableMutator>

Gets the mutator that this collection applies to a variable, if any.

Parameters:

variable

The variable to get the mutator for.

forEach(callback:(variable:String, mutator:EnvironmentVariableMutator, collection:EnvironmentVariableCollection) ‑> Any, ?thisArg:Any):Void

Iterate over each mutator in this collection.

Parameters:

callback

Function to execute for each entry.

thisArg

The this context used when invoking the handler function.

delete(variable:String):Void

Deletes this collection's mutator for a variable.

Parameters:

variable

The variable to delete the mutator for.

clear():Void

Clears all mutators from this collection.

append(variable:String, value:String):Void

Append a value to an environment variable.

Note that an extension can only make a single change to any one variable, so this will overwrite any previous calls to replace, append or prepend.

Parameters:

variable

The variable to append to.

value

The value to append to the variable.

options

Options applied to the mutator, when no options are provided this will default to { applyAtProcessCreation: true }.