Skip to content

Commit d09d265

Browse files
committed
fix: streamline environment retrieval in venvManager and pyenvManager
1 parent 78d7fe9 commit d09d265

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/managers/builtin/venvManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class VenvManager implements EnvironmentManager {
142142

143143
const venvRoot: Uri = Uri.file(await findParentIfFile(uri.fsPath));
144144

145-
const globals = await this.baseManager.getEnvironments('global');
145+
const globals = await this.api.getEnvironments('global');
146146
let result: CreateEnvironmentResult | undefined = undefined;
147147
if (options?.quickCreate) {
148148
// error on missing information
@@ -492,7 +492,7 @@ export class VenvManager implements EnvironmentManager {
492492

493493
private async resetGlobalEnv() {
494494
this.globalEnv = undefined;
495-
const globals = await this.baseManager.getEnvironments('global');
495+
const globals = await this.api.getEnvironments('global');
496496
await this.loadGlobalEnv(globals);
497497
}
498498

@@ -535,7 +535,7 @@ export class VenvManager implements EnvironmentManager {
535535
* Loads and maps Python environments to their corresponding project paths in the workspace. about O(p × e) where p = projects.len and e = environments.len
536536
*/
537537
private async loadEnvMap() {
538-
const globals = await this.baseManager.getEnvironments('global');
538+
const globals = await this.api.getEnvironments('global');
539539
await this.loadGlobalEnv(globals);
540540

541541
this.fsPathToEnv.clear();

src/managers/pyenv/pyenvManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ export class PyEnvManager implements EnvironmentManager, Disposable {
9696
}
9797

9898
if (scope === 'global') {
99-
return this.collection.filter((env) => {
100-
env.group === PYENV_VERSIONS;
101-
});
99+
return this.collection.filter((env) => env.group === PYENV_VERSIONS);
102100
}
103101

104102
if (scope instanceof Uri) {

0 commit comments

Comments
 (0)