Skip to content

Commit dbd6e71

Browse files
Clarify about the "vscode" flag in IocContainer.
1 parent a8f4690 commit dbd6e71

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
@@ -296,7 +296,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer {
296296

297297
constructor() {
298298
super();
299-
this.vscode = false;
299+
this.useVSCodeAPI = false;
300300
const isRollingBuild = process.env ? process.env.VSCODE_PYTHON_ROLLING !== undefined : false;
301301
this.shouldMockJupyter = !isRollingBuild;
302302
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)