-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Closed
Labels
Milestone
Description
This issue tracks the overall improvements for the upcoming API improvements so they're all in one place:
- Allow EnvironmentVariableCollection API to apply changes via shell integration #179476
- Allow specifying workspace-specific EnvironmentVariableCollection mutators #171173
- Allow to provide description to environment collection API #171108
We don't currently have a proposal for the first issue but the combined proposal for the other two is currently:
export interface EnvironmentVariableMutator {
readonly type: EnvironmentVariableMutatorType;
readonly value: string;
readonly scope: EnvironmentVariableScope | undefined;
}
export interface EnvironmentVariableCollection extends Iterable<[variable: string, mutator: EnvironmentVariableMutator]> {
/**
* Sets a description for the environment variable collection, this will be used to describe the changes in the UI.
* @param description A description for the environment variable collection.
* @param scope The scope to which this description applies to. If unspecified, operation applies to all
* workspace folders.
*/
setDescription(description: string | MarkdownString | undefined, scope?: EnvironmentVariableScope): void;
replace(variable: string, value: string, scope?: EnvironmentVariableScope): void;
append(variable: string, value: string, scope?: EnvironmentVariableScope): void;
prepend(variable: string, value: string, scope?: EnvironmentVariableScope): void;
get(variable: string, scope?: EnvironmentVariableScope): EnvironmentVariableMutator | undefined;
delete(variable: string, scope?: EnvironmentVariableScope): void;
clear(scope?: EnvironmentVariableScope): void;
}
export type EnvironmentVariableScope = {
/**
* The workspace folder to which this collection applies to. If unspecified, collection applies to all workspace folders.
*/
workspaceFolder?: WorkspaceFolder;
};
I have given feedback about scope
being everywhere and maybe we should have a getScopedEnvironmentVariableCollection
API on ExtensionContext
instead of peppering it everywhere.