diff --git a/news/2 Fixes/18847.md b/news/2 Fixes/18847.md new file mode 100644 index 000000000000..fe55719fdde8 --- /dev/null +++ b/news/2 Fixes/18847.md @@ -0,0 +1 @@ +Fix launch of Python Debugger when using conda environments. diff --git a/src/client/debugger/extension/adapter/factory.ts b/src/client/debugger/extension/adapter/factory.ts index 37d2f669a3cf..a001ba2ad42c 100644 --- a/src/client/debugger/extension/adapter/factory.ts +++ b/src/client/debugger/extension/adapter/factory.ts @@ -16,8 +16,7 @@ import { IApplicationShell } from '../../../common/application/types'; import { EXTENSION_ROOT_DIR } from '../../../constants'; import { IInterpreterService } from '../../../interpreter/contracts'; import { traceLog, traceVerbose } from '../../../logging'; -import { Conda } from '../../../pythonEnvironments/common/environmentManagers/conda'; -import { EnvironmentType, PythonEnvironment } from '../../../pythonEnvironments/info'; +import { PythonEnvironment } from '../../../pythonEnvironments/info'; import { sendTelemetryEvent } from '../../../telemetry'; import { EventName } from '../../../telemetry/constants'; import { AttachRequestArguments, LaunchRequestArguments } from '../../types'; @@ -143,40 +142,8 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac return this.getExecutableCommand(interpreters[0]); } - private async getCondaCommand(): Promise { - const condaCommand = await Conda.getConda(); - const isCondaRunSupported = await condaCommand?.isCondaRunSupported(); - return isCondaRunSupported ? condaCommand : undefined; - } - private async getExecutableCommand(interpreter: PythonEnvironment | undefined): Promise { if (interpreter) { - if (interpreter.envType === EnvironmentType.Conda) { - const condaCommand = await this.getCondaCommand(); - if (condaCommand) { - if (interpreter.envName) { - return [ - condaCommand.command, - 'run', - '-n', - interpreter.envName, - '--no-capture-output', - '--live-stream', - 'python', - ]; - } else if (interpreter.envPath) { - return [ - condaCommand.command, - 'run', - '-p', - interpreter.envPath, - '--no-capture-output', - '--live-stream', - 'python', - ]; - } - } - } return interpreter.path.length > 0 ? [interpreter.path] : []; } return [];