diff --git a/src/client/envExt/api.internal.ts b/src/client/envExt/api.internal.ts index c4247f63a3c5..07bc58ffc11e 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, @@ -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'; @@ -128,32 +127,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..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'; @@ -55,7 +48,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 +87,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(