Temporarily finalize getScopedEnvironmentVariableCollection

This commit is contained in:
Kartik Raj 2023-05-18 18:05:47 +00:00
parent 3a4c2b151a
commit 88799ca215
4 changed files with 12 additions and 13 deletions

View file

@ -523,8 +523,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
return that.extensionRuntime;
},
get environmentVariableCollection() {
// TODO: Remove `as` cast once workspace collection proposal is finalized.
return (that._extHostTerminalService.getEnvironmentVariableCollection(extensionDescription) as vscode.EnvironmentVariableCollection);
return that._extHostTerminalService.getEnvironmentVariableCollection(extensionDescription);
},
get messagePassingProtocol() {
if (!messagePassingProtocol) {

View file

@ -52,7 +52,7 @@ export interface IExtHostTerminalService extends ExtHostTerminalServiceShape, ID
registerTerminalQuickFixProvider(id: string, extensionId: string, provider: vscode.TerminalQuickFixProvider): vscode.Disposable;
getEnvironmentVariableCollection(extension: IExtensionDescription): IDefaultEnvironmentVariableCollection;
}
type IDefaultEnvironmentVariableCollection = vscode.EnvironmentVariableCollection | { getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): vscode.EnvironmentVariableCollection };
type IDefaultEnvironmentVariableCollection = vscode.EnvironmentVariableCollection & { getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): vscode.EnvironmentVariableCollection };
export interface ITerminalInternalOptions {
isFeatureTerminal?: boolean;
useShellEnvironment?: boolean;

View file

@ -7163,7 +7163,7 @@ declare module 'vscode' {
* Gets the extension's environment variable collection for this workspace, enabling changes
* to be applied to terminal environment variables.
*/
readonly environmentVariableCollection: EnvironmentVariableCollection;
readonly environmentVariableCollection: EnvironmentVariableCollection & { getScopedEnvironmentVariableCollection(scope: EnvironmentVariableScope): EnvironmentVariableCollection };
/**
* Get the absolute path of a resource contained in the extension.

View file

@ -7,15 +7,15 @@ declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/182069
// export interface ExtensionContext {
// /**
// * Gets the extension's environment variable collection for this workspace, enabling changes
// * to be applied to terminal environment variables.
// *
// * @param scope The scope to which the environment variable collection applies to.
// */
// readonly environmentVariableCollection: EnvironmentVariableCollection | { getScopedEnvironmentVariableCollection(scope: EnvironmentVariableScope): EnvironmentVariableCollection };
// }
export interface ExtensionContext {
/**
* Gets the extension's environment variable collection for this workspace, enabling changes
* to be applied to terminal environment variables.
*
* @param scope The scope to which the environment variable collection applies to.
*/
readonly environmentVariableCollection: EnvironmentVariableCollection & { getScopedEnvironmentVariableCollection(scope: EnvironmentVariableScope): EnvironmentVariableCollection };
}
export type EnvironmentVariableScope = {
/**