Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Mar 15, 2023
1 parent ba6ac95 commit 4330a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/client/interpreter/interpreterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export class InterpreterService implements Disposable, IInterpreterService {
.then(async () => {
// Fetch interpreter details so the cache is updated to include the newly installed Python.
await this.getInterpreterDetails(pythonPath);
// Fire an event as the executable for the environment has changed.
this.didChangeInterpreterEmitter.fire(workspaceFolder?.uri);
reportActiveInterpreterChanged({
path: pythonPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,9 @@ export class PythonEnvInfoCache extends PythonEnvsWatcher<PythonEnvCollectionCha
if (!found) {
this.envs.push(env);
this.fire({ new: env });
} else if (hasLatestInfo) {
const isValidated = this.validatedEnvs.has(env.id!);
if (!isValidated) {
// Update cache only if we have latest info and the env is not already validated.
this.updateEnv(found, env, true);
}
} else if (hasLatestInfo && !this.validatedEnvs.has(env.id!)) {
// Update cache if we have latest info and the env is not already validated.
this.updateEnv(found, env, true);
}
if (hasLatestInfo) {
traceVerbose(`Flushing env to cache ${env.id}`);
Expand Down

0 comments on commit 4330a98

Please sign in to comment.