Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/managers/builtin/sysPythonManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class SysPythonManager implements EnvironmentManager {
const discard = this.collection.map((c) => c);

// hit here is fine...
this.collection = await refreshPythons(hardRefresh, this.nativeFinder, this.api, this.log, this);
this.collection = (await refreshPythons(hardRefresh, this.nativeFinder, this.api, this.log, this)) ?? [];
await this.loadEnvMap();

const args = [
Expand Down
4 changes: 2 additions & 2 deletions src/managers/builtin/venvManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ export class VenvManager implements EnvironmentManager {
environment: env,
}));

this.collection = await findVirtualEnvironments(
this.collection = (await findVirtualEnvironments(
hardRefresh,
this.nativeFinder,
this.api,
this.log,
this,
scope ? [scope] : undefined,
);
)) ?? [];
await this.loadEnvMap();

const added = this.collection.map((env) => ({ environment: env, kind: EnvironmentChangeKind.add }));
Expand Down
6 changes: 3 additions & 3 deletions src/managers/conda/condaEnvManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class CondaEnvManager implements EnvironmentManager, Disposable {
title: CondaStrings.condaDiscovering,
},
async () => {
this.collection = await refreshCondaEnvs(false, this.nativeFinder, this.api, this.log, this);
this.collection = (await refreshCondaEnvs(false, this.nativeFinder, this.api, this.log, this)) ?? [];
await this.loadEnvMap();

this._onDidChangeEnvironments.fire(
Expand Down Expand Up @@ -246,7 +246,7 @@ export class CondaEnvManager implements EnvironmentManager, Disposable {
async () => {
this.log.info('Refreshing Conda Environments');
const discard = this.collection.map((c) => c);
this.collection = await refreshCondaEnvs(true, this.nativeFinder, this.api, this.log, this);
this.collection = (await refreshCondaEnvs(true, this.nativeFinder, this.api, this.log, this)) ?? [];

await this.loadEnvMap();

Expand All @@ -273,7 +273,7 @@ export class CondaEnvManager implements EnvironmentManager, Disposable {
resolve: (p) => resolveCondaPath(p, this.nativeFinder, this.api, this.log, this),
startBackgroundInit: () =>
withProgress({ location: ProgressLocation.Window, title: CondaStrings.condaDiscovering }, async () => {
this.collection = await refreshCondaEnvs(false, this.nativeFinder, this.api, this.log, this);
this.collection = (await refreshCondaEnvs(false, this.nativeFinder, this.api, this.log, this)) ?? [];
await this.loadEnvMap();
this._onDidChangeEnvironments.fire(
this.collection.map((e) => ({
Expand Down
6 changes: 3 additions & 3 deletions src/managers/pipenv/pipenvManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class PipenvManager implements EnvironmentManager, Disposable {
title: PipenvStrings.pipenvDiscovering,
},
async () => {
this.collection = await refreshPipenv(false, this.nativeFinder, this.api, this);
this.collection = (await refreshPipenv(false, this.nativeFinder, this.api, this)) ?? [];
await this.loadEnvMap();

this._onDidChangeEnvironments.fire(
Expand Down Expand Up @@ -181,7 +181,7 @@ export class PipenvManager implements EnvironmentManager, Disposable {
async () => {
traceInfo('Refreshing Pipenv Environments');
const oldCollection = [...this.collection];
this.collection = await refreshPipenv(hardRefresh, this.nativeFinder, this.api, this);
this.collection = (await refreshPipenv(hardRefresh, this.nativeFinder, this.api, this)) ?? [];
await this.loadEnvMap();

// Fire change events for environments that were added or removed
Expand Down Expand Up @@ -317,7 +317,7 @@ export class PipenvManager implements EnvironmentManager, Disposable {
withProgress(
{ location: ProgressLocation.Window, title: PipenvStrings.pipenvDiscovering },
async () => {
this.collection = await refreshPipenv(false, this.nativeFinder, this.api, this);
this.collection = (await refreshPipenv(false, this.nativeFinder, this.api, this)) ?? [];
await this.loadEnvMap();
this._onDidChangeEnvironments.fire(
this.collection.map((e) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/managers/poetry/poetryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class PoetryManager implements EnvironmentManager, Disposable {
title: PoetryStrings.poetryDiscovering,
},
async () => {
this.collection = await refreshPoetry(false, this.nativeFinder, this.api, this);
this.collection = (await refreshPoetry(false, this.nativeFinder, this.api, this)) ?? [];
await this.loadEnvMap();

this._onDidChangeEnvironments.fire(
Expand Down Expand Up @@ -172,7 +172,7 @@ export class PoetryManager implements EnvironmentManager, Disposable {
async () => {
traceInfo('Refreshing Poetry Environments');
const discard = this.collection.map((c) => c);
this.collection = await refreshPoetry(true, this.nativeFinder, this.api, this);
this.collection = (await refreshPoetry(true, this.nativeFinder, this.api, this)) ?? [];

await this.loadEnvMap();

Expand Down
6 changes: 3 additions & 3 deletions src/managers/pyenv/pyenvManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class PyEnvManager implements EnvironmentManager, Disposable {
title: PyenvStrings.pyenvDiscovering,
},
async () => {
this.collection = await refreshPyenv(false, this.nativeFinder, this.api, this);
this.collection = (await refreshPyenv(false, this.nativeFinder, this.api, this)) ?? [];
await this.loadEnvMap();

this._onDidChangeEnvironments.fire(
Expand Down Expand Up @@ -170,7 +170,7 @@ export class PyEnvManager implements EnvironmentManager, Disposable {
async () => {
traceInfo('Refreshing Pyenv Environments');
const discard = this.collection.map((c) => c);
this.collection = await refreshPyenv(true, this.nativeFinder, this.api, this);
this.collection = (await refreshPyenv(true, this.nativeFinder, this.api, this)) ?? [];

await this.loadEnvMap();

Expand Down Expand Up @@ -198,7 +198,7 @@ export class PyEnvManager implements EnvironmentManager, Disposable {
resolve: (p) => resolvePyenvPath(p, this.nativeFinder, this.api, this),
startBackgroundInit: () =>
withProgress({ location: ProgressLocation.Window, title: PyenvStrings.pyenvDiscovering }, async () => {
this.collection = await refreshPyenv(false, this.nativeFinder, this.api, this);
this.collection = (await refreshPyenv(false, this.nativeFinder, this.api, this)) ?? [];
await this.loadEnvMap();
this._onDidChangeEnvironments.fire(
this.collection.map((e) => ({
Expand Down
Loading