From 4acb80c2f3611806e36ff723d3018363fdaf4808 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Tue, 13 Jan 2026 19:55:19 -0800 Subject: [PATCH 1/2] remove method to update defaultInterpreterPath on env ext environment change --- src/client/envExt/api.internal.ts | 31 +------------------------------ src/client/extensionActivation.ts | 5 ----- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/client/envExt/api.internal.ts b/src/client/envExt/api.internal.ts index c4247f63a3c5..6d4b7f9cfc90 100644 --- a/src/client/envExt/api.internal.ts +++ b/src/client/envExt/api.internal.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { EventEmitter, Terminal, Uri, Disposable, ConfigurationTarget } from 'vscode'; +import { EventEmitter, Terminal, Uri, Disposable } from 'vscode'; import { getExtension } from '../common/vscodeApis/extensionsApi'; import { GetEnvironmentScope, @@ -128,32 +128,3 @@ export async function clearCache(): Promise { await executeCommand('python-envs.clearCache'); } } - -export function registerEnvExtFeatures( - disposables: Disposable[], - interpreterPathService: IInterpreterPathService, -): void { - if (useEnvExtension()) { - disposables.push( - onDidChangeEnvironmentEnvExt(async (e: DidChangeEnvironmentEventArgs) => { - const previousPath = interpreterPathService.get(e.uri); - - if (previousPath !== e.new?.environmentPath.fsPath) { - if (e.uri) { - await interpreterPathService.update( - e.uri, - ConfigurationTarget.WorkspaceFolder, - e.new?.environmentPath.fsPath, - ); - } else { - await interpreterPathService.update( - undefined, - ConfigurationTarget.Global, - e.new?.environmentPath.fsPath, - ); - } - } - }), - ); - } -} diff --git a/src/client/extensionActivation.ts b/src/client/extensionActivation.ts index 6e870e37ef3e..632262c9a6e5 100644 --- a/src/client/extensionActivation.ts +++ b/src/client/extensionActivation.ts @@ -55,7 +55,6 @@ import { registerTriggerForTerminalREPL } from './terminals/codeExecution/termin import { registerPythonStartup } from './terminals/pythonStartup'; import { registerPixiFeatures } from './pythonEnvironments/common/environmentManagers/pixi'; import { registerCustomTerminalLinkProvider } from './terminals/pythonStartupLinkProvider'; -import { registerEnvExtFeatures } from './envExt/api.internal'; export async function activateComponents( // `ext` is passed to any extra activation funcs. @@ -95,13 +94,9 @@ export function activateFeatures(ext: ExtensionState, _components: Components): const interpreterQuickPick: IInterpreterQuickPick = ext.legacyIOC.serviceContainer.get( IInterpreterQuickPick, ); - const interpreterPathService: IInterpreterPathService = ext.legacyIOC.serviceContainer.get( - IInterpreterPathService, - ); const interpreterService: IInterpreterService = ext.legacyIOC.serviceContainer.get( IInterpreterService, ); - registerEnvExtFeatures(ext.disposables, interpreterPathService); const pathUtils = ext.legacyIOC.serviceContainer.get(IPathUtils); registerPixiFeatures(ext.disposables); registerAllCreateEnvironmentFeatures( From 78c4a6ea4f3c8b627aef19e5755d5eb5e76c92f9 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Tue, 13 Jan 2026 19:57:29 -0800 Subject: [PATCH 2/2] update imports --- src/client/envExt/api.internal.ts | 1 - src/client/extensionActivation.ts | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/client/envExt/api.internal.ts b/src/client/envExt/api.internal.ts index 6d4b7f9cfc90..07bc58ffc11e 100644 --- a/src/client/envExt/api.internal.ts +++ b/src/client/envExt/api.internal.ts @@ -13,7 +13,6 @@ import { DidChangeEnvironmentEventArgs, } from './types'; import { executeCommand } from '../common/vscodeApis/commandApis'; -import { IInterpreterPathService } from '../common/types'; import { getConfiguration } from '../common/vscodeApis/workspaceApis'; export const ENVS_EXTENSION_ID = 'ms-python.vscode-python-envs'; diff --git a/src/client/extensionActivation.ts b/src/client/extensionActivation.ts index 632262c9a6e5..57bcb8237eeb 100644 --- a/src/client/extensionActivation.ts +++ b/src/client/extensionActivation.ts @@ -13,14 +13,7 @@ import { IApplicationEnvironment, ICommandManager, IWorkspaceService } from './c import { Commands, PYTHON_LANGUAGE, UseProposedApi } from './common/constants'; import { registerTypes as installerRegisterTypes } from './common/installer/serviceRegistry'; import { IFileSystem } from './common/platform/types'; -import { - IConfigurationService, - IDisposableRegistry, - IExtensions, - IInterpreterPathService, - ILogOutputChannel, - IPathUtils, -} from './common/types'; +import { IConfigurationService, IDisposableRegistry, IExtensions, ILogOutputChannel, IPathUtils } from './common/types'; import { noop } from './common/utils/misc'; import { registerTypes as debugConfigurationRegisterTypes } from './debugger/extension/serviceRegistry'; import { IDebugConfigurationService } from './debugger/extension/types';