Skip to content

Commit 693517e

Browse files
author
Kartik Raj
committed
Add comments
1 parent ba6ac95 commit 693517e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/client/interpreter/interpreterService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ export class InterpreterService implements Disposable, IInterpreterService {
265265
.then(async () => {
266266
// Fetch interpreter details so the cache is updated to include the newly installed Python.
267267
await this.getInterpreterDetails(pythonPath);
268+
// Fire an event as the executable for the environment has changed.
268269
this.didChangeInterpreterEmitter.fire(workspaceFolder?.uri);
269270
reportActiveInterpreterChanged({
270271
path: pythonPath,

src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,9 @@ export class PythonEnvInfoCache extends PythonEnvsWatcher<PythonEnvCollectionCha
150150
if (!found) {
151151
this.envs.push(env);
152152
this.fire({ new: env });
153-
} else if (hasLatestInfo) {
154-
const isValidated = this.validatedEnvs.has(env.id!);
155-
if (!isValidated) {
156-
// Update cache only if we have latest info and the env is not already validated.
157-
this.updateEnv(found, env, true);
158-
}
153+
} else if (hasLatestInfo && this.validatedEnvs.has(env.id!)) {
154+
// Update cache if we have latest info and the env is not already validated.
155+
this.updateEnv(found, env, true);
159156
}
160157
if (hasLatestInfo) {
161158
traceVerbose(`Flushing env to cache ${env.id}`);

0 commit comments

Comments
 (0)