Skip to content

Commit 8345e44

Browse files
authored
Speed up virtual environment detection in workspace (#405)
* Fixes #372
1 parent 735d033 commit 8345e44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/client/interpreter/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class InterpreterManager implements Disposable {
4545
const virtualEnvMgr = this.serviceContainer.get<IVirtualEnvironmentManager>(IVirtualEnvironmentManager);
4646
const versionService = this.serviceContainer.get<IInterpreterVersionService>(IInterpreterVersionService);
4747
const virtualEnvInterpreterProvider = new VirtualEnvService([activeWorkspace.folderUri.fsPath], virtualEnvMgr, versionService);
48-
const interpreters = await this.interpreterProvider.getInterpreters(activeWorkspace.folderUri);
48+
const interpreters = await virtualEnvInterpreterProvider.getInterpreters(activeWorkspace.folderUri);
4949
const workspacePathUpper = activeWorkspace.folderUri.fsPath.toUpperCase();
5050
const interpretersInWorkspace = interpreters.filter(interpreter => interpreter.path.toUpperCase().startsWith(workspacePathUpper));
5151
// Always pick the first available one.
@@ -80,10 +80,10 @@ export class InterpreterManager implements Disposable {
8080
return false;
8181
}
8282
if (activeWorkspace.configTarget === ConfigurationTarget.Workspace) {
83-
return pythonPathInConfig.workspaceValue === undefined || pythonPathInConfig.workspaceValue === 'python';
83+
return pythonPathInConfig!.workspaceValue === undefined || pythonPathInConfig!.workspaceValue === 'python';
8484
}
8585
if (activeWorkspace.configTarget === ConfigurationTarget.WorkspaceFolder) {
86-
return pythonPathInConfig.workspaceFolderValue === undefined || pythonPathInConfig.workspaceFolderValue === 'python';
86+
return pythonPathInConfig!.workspaceFolderValue === undefined || pythonPathInConfig!.workspaceFolderValue === 'python';
8787
}
8888
return false;
8989
}

0 commit comments

Comments
 (0)