Skip to content

Commit 65c3147

Browse files
committed
Suggestions by Copilot
1 parent e21d838 commit 65c3147

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/desktop/env-manager.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class PythonEnvironmentExtensionWrapper {
177177
}
178178

179179
class EnvironmentManagerImpl implements EnvironmentManager {
180+
private lastEnvVars: string | undefined;
180181

181182
private pyEnvWrapper: Optional<PythonEnvironmentExtensionWrapper> = undefined;
182183
private context: vscode.ExtensionContext | undefined = undefined;
@@ -240,6 +241,16 @@ class EnvironmentManagerImpl implements EnvironmentManager {
240241
});
241242
}
242243

244+
const vars = envSettings.vars;
245+
const currentEnvVars = JSON.stringify(
246+
Object.entries(vars)
247+
.filter(([, v]) => v !== undefined)
248+
.sort(([a], [b]) => a.localeCompare(b)),
249+
);
250+
if (currentEnvVars === this.lastEnvVars) {
251+
return;
252+
}
253+
243254
context.environmentVariableCollection.clear();
244255
for (const [key, value] of Object.entries(envSettings.vars)) {
245256
if (value !== undefined) {
@@ -250,7 +261,7 @@ class EnvironmentManagerImpl implements EnvironmentManager {
250261
}
251262
}
252263
}
253-
264+
this.lastEnvVars = currentEnvVars;
254265
this.envVarsChangeEmitter.fire();
255266
}
256267
}

src/solutions/solution-manager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ describe('SolutionManager', () => {
312312
expect.objectContaining({
313313
solutionPath: testSolutionPath,
314314
updateRte: false,
315-
restartRpc: true,
315+
restartRpc: true,
316316
lockAbort: false,
317317
}),
318318
);

0 commit comments

Comments
 (0)