From 4b6de6baf97ba00468d4015a35c31650e4b22303 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 7 Sep 2021 11:40:13 -0700 Subject: [PATCH 1/2] Ensure we trigger discovery for the first time as part of extension activation --- news/2 Fixes/17303.md | 1 + .../base/locators/composite/envsCollectionService.ts | 3 +++ src/client/pythonEnvironments/index.ts | 6 ++---- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 news/2 Fixes/17303.md diff --git a/news/2 Fixes/17303.md b/news/2 Fixes/17303.md new file mode 100644 index 000000000000..b995c190008f --- /dev/null +++ b/news/2 Fixes/17303.md @@ -0,0 +1 @@ +Ensure we trigger discovery for the first time as part of extension activation. diff --git a/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts b/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts index 49d95f55bd97..61eb61a451d1 100644 --- a/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts +++ b/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts @@ -55,6 +55,9 @@ export class EnvsCollectionService extends PythonEnvsWatcher { }; } - addItemsToRunAfterActivation(() => { - // Force an initial background refresh of the environments. - api.triggerRefresh().ignoreErrors(); - }); + // Force an initial background refresh of the environments. + api.triggerRefresh().ignoreErrors(); return { fullyReady: Promise.resolve(), From 3882954c7018a37d2406a13a0913d0515f8b1ea2 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 7 Sep 2021 11:44:24 -0700 Subject: [PATCH 2/2] Oops --- src/client/pythonEnvironments/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/pythonEnvironments/index.ts b/src/client/pythonEnvironments/index.ts index 17b2d2e12699..e0adb383bf65 100644 --- a/src/client/pythonEnvironments/index.ts +++ b/src/client/pythonEnvironments/index.ts @@ -30,7 +30,6 @@ import { IEnvsCollectionCache, } from './base/locators/composite/envsCollectionCache'; import { EnvsCollectionService } from './base/locators/composite/envsCollectionService'; -import { addItemsToRunAfterActivation } from '../common/utils/runAfterActivation'; /** * Set up the Python environments component (during extension activation).'