Skip to content

Commit bce30b7

Browse files
Clarify about the "vscode" flag in IocContainer.
1 parent 6ce69a4 commit bce30b7

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
@@ -115,7 +115,11 @@ class LegacyFileSystem extends FileSystem {
115115
}
116116

117117
export class IocContainer {
118-
public vscode = true;
118+
// This may be set (before any registration happens) to indicate
119+
// whether or not IOC should depend on the VS Code API (e.g. the
120+
// "vscode" module). So in "functional" tests, this should be set
121+
// to "false".
122+
public useVSCodeAPI = true;
119123

120124
public readonly serviceManager: IServiceManager;
121125
public readonly serviceContainer: IServiceContainer;
@@ -165,7 +169,7 @@ export class IocContainer {
165169
this.serviceManager.addSingleton<IPlatformService>(IPlatformService, PlatformService);
166170
this.serviceManager.addSingleton<IFileSystem>(
167171
IFileSystem,
168-
this.vscode ? FileSystem : LegacyFileSystem
172+
this.useVSCodeAPI ? FileSystem : LegacyFileSystem
169173
);
170174
}
171175
public registerProcessTypes() {

0 commit comments

Comments
 (0)