Skip to content

Commit 88799ca

Browse files
author
Kartik Raj
committed
Temporarily finalize getScopedEnvironmentVariableCollection
1 parent 3a4c2b1 commit 88799ca

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/vs/workbench/api/common/extHostExtensionService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
523523
return that.extensionRuntime;
524524
},
525525
get environmentVariableCollection() {
526-
// TODO: Remove `as` cast once workspace collection proposal is finalized.
527-
return (that._extHostTerminalService.getEnvironmentVariableCollection(extensionDescription) as vscode.EnvironmentVariableCollection);
526+
return that._extHostTerminalService.getEnvironmentVariableCollection(extensionDescription);
528527
},
529528
get messagePassingProtocol() {
530529
if (!messagePassingProtocol) {

src/vs/workbench/api/common/extHostTerminalService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface IExtHostTerminalService extends ExtHostTerminalServiceShape, ID
5252
registerTerminalQuickFixProvider(id: string, extensionId: string, provider: vscode.TerminalQuickFixProvider): vscode.Disposable;
5353
getEnvironmentVariableCollection(extension: IExtensionDescription): IDefaultEnvironmentVariableCollection;
5454
}
55-
type IDefaultEnvironmentVariableCollection = vscode.EnvironmentVariableCollection | { getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): vscode.EnvironmentVariableCollection };
55+
type IDefaultEnvironmentVariableCollection = vscode.EnvironmentVariableCollection & { getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): vscode.EnvironmentVariableCollection };
5656
export interface ITerminalInternalOptions {
5757
isFeatureTerminal?: boolean;
5858
useShellEnvironment?: boolean;

src/vscode-dts/vscode.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7163,7 +7163,7 @@ declare module 'vscode' {
71637163
* Gets the extension's environment variable collection for this workspace, enabling changes
71647164
* to be applied to terminal environment variables.
71657165
*/
7166-
readonly environmentVariableCollection: EnvironmentVariableCollection;
7166+
readonly environmentVariableCollection: EnvironmentVariableCollection & { getScopedEnvironmentVariableCollection(scope: EnvironmentVariableScope): EnvironmentVariableCollection };
71677167

71687168
/**
71697169
* Get the absolute path of a resource contained in the extension.

src/vscode-dts/vscode.proposed.envCollectionWorkspace.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ declare module 'vscode' {
77

88
// https://github.com/microsoft/vscode/issues/182069
99

10-
// export interface ExtensionContext {
11-
// /**
12-
// * Gets the extension's environment variable collection for this workspace, enabling changes
13-
// * to be applied to terminal environment variables.
14-
// *
15-
// * @param scope The scope to which the environment variable collection applies to.
16-
// */
17-
// readonly environmentVariableCollection: EnvironmentVariableCollection | { getScopedEnvironmentVariableCollection(scope: EnvironmentVariableScope): EnvironmentVariableCollection };
18-
// }
10+
export interface ExtensionContext {
11+
/**
12+
* Gets the extension's environment variable collection for this workspace, enabling changes
13+
* to be applied to terminal environment variables.
14+
*
15+
* @param scope The scope to which the environment variable collection applies to.
16+
*/
17+
readonly environmentVariableCollection: EnvironmentVariableCollection & { getScopedEnvironmentVariableCollection(scope: EnvironmentVariableScope): EnvironmentVariableCollection };
18+
}
1919

2020
export type EnvironmentVariableScope = {
2121
/**

0 commit comments

Comments
 (0)