Skip to content

Commit 30d9128

Browse files
Clarify about the "vscode" flag in IocContainer.
1 parent e6a2ba5 commit 30d9128

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/test/datascience/dataScienceIocContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer {
298298

299299
constructor() {
300300
super();
301-
this.vscode = false;
301+
this.useVSCodeAPI = false;
302302
const isRollingBuild = process.env ? process.env.VSCODE_PYTHON_ROLLING !== undefined : false;
303303
this.shouldMockJupyter = !isRollingBuild;
304304
this.asyncRegistry = new AsyncDisposableRegistry();

src/test/serviceRegistry.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ class LegacyFileSystem extends FileSystem {
130130
}
131131

132132
export class IocContainer {
133-
public vscode = true;
133+
// This may be set (before any registration happens) to indicate
134+
// whether or not IOC should depend on the VS Code API (e.g. the
135+
// "vscode" module). So in "functional" tests, this should be set
136+
// to "false".
137+
public useVSCodeAPI = true;
134138

135139
public readonly serviceManager: IServiceManager;
136140
public readonly serviceContainer: IServiceContainer;
@@ -180,7 +184,7 @@ export class IocContainer {
180184
this.serviceManager.addSingleton<IPlatformService>(IPlatformService, PlatformService);
181185
this.serviceManager.addSingleton<IFileSystem>(
182186
IFileSystem,
183-
this.vscode ? FileSystem : LegacyFileSystem
187+
this.useVSCodeAPI ? FileSystem : LegacyFileSystem
184188
);
185189
}
186190
public registerProcessTypes() {

0 commit comments

Comments
 (0)