Theia API Documentation v1.65.0
    Preparing search index...

    A collection of mutations that an extension can apply to a process environment. Applies to all scopes.

    interface GlobalEnvironmentVariableCollection {
        description: undefined | string | MarkdownString;
        persistent: boolean;
        append(
            variable: string,
            value: string,
            options?: EnvironmentVariableMutatorOptions,
        ): void;
        clear(): void;
        delete(variable: string): void;
        forEach(
            callback: (
                variable: string,
                mutator: EnvironmentVariableMutator,
                collection: EnvironmentVariableCollection,
            ) => any,
            thisArg?: any,
        ): void;
        get(variable: string): undefined | EnvironmentVariableMutator;
        getScoped(scope: EnvironmentVariableScope): EnvironmentVariableCollection;
        prepend(
            variable: string,
            value: string,
            options?: EnvironmentVariableMutatorOptions,
        ): void;
        replace(
            variable: string,
            value: string,
            options?: EnvironmentVariableMutatorOptions,
        ): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    description: undefined | string | MarkdownString

    A description for the environment variable collection, this will be used to describe the changes in the UI.

    persistent: boolean

    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.

    Methods

    • 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: EnvironmentVariableScope

        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 EnvironmentVariableCollection

      Environment variable collection for the passed in scope.