diff --git a/src/extension/debugger/adapter/factory.ts b/src/extension/debugger/adapter/factory.ts index aa83b3bd..dc3773b0 100644 --- a/src/extension/debugger/adapter/factory.ts +++ b/src/extension/debugger/adapter/factory.ts @@ -116,8 +116,6 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac ): Promise { if (configuration.debugAdapterPython !== undefined) { return this.getExecutableCommand(await resolveEnvironment(configuration.debugAdapterPython)); - } else if (configuration.pythonPath) { - return this.getExecutableCommand(await resolveEnvironment(configuration.pythonPath)); } const resourceUri = workspaceFolder ? workspaceFolder.uri : undefined; diff --git a/src/extension/debugger/configuration/resolvers/base.ts b/src/extension/debugger/configuration/resolvers/base.ts index 8b887107..a34a0ff5 100644 --- a/src/extension/debugger/configuration/resolvers/base.ts +++ b/src/extension/debugger/configuration/resolvers/base.ts @@ -125,7 +125,7 @@ export abstract class BaseConfigurationResolver } /** - * Resolves Python interpreter paths and handles the legacy pythonPath deprecation. + * Resolves Python interpreter paths. * * @param workspaceFolder The workspace folder URI for variable resolution and interpreter detection * @param debugConfiguration The launch configuration to update with resolved Python paths @@ -145,7 +145,6 @@ export abstract class BaseConfigurationResolver traceLog( `resolveAndUpdatePythonPath - Initial state: ` + - `pythonPath='${debugConfiguration.pythonPath}', ` + `python='${debugConfiguration.python}', ` + `debugAdapterPython='${debugConfiguration.debugAdapterPython}', ` + `debugLauncherPython='${debugConfiguration.debugLauncherPython}', ` + @@ -153,29 +152,11 @@ export abstract class BaseConfigurationResolver `resolvedInterpreterPath='${resolvedInterpreterPath}'`, ); - // STEP 1: Resolve legacy pythonPath property (DEPRECATED) - // pythonPath will equal user set value, or getInterpreterDetails if undefined or set to command - if (debugConfiguration.pythonPath === '${command:python.interpreterPath}' || !debugConfiguration.pythonPath) { - this.pythonPathSource = PythonPathSource.settingsJson; - debugConfiguration.pythonPath = resolvedInterpreterPath; - } else { - // User provided explicit pythonPath in launch.json - debugConfiguration.pythonPath = resolveWorkspaceVariables( - debugConfiguration.pythonPath, - workspaceFolder?.fsPath, - undefined, - ); - } - - // STEP 2: Resolve current python property (CURRENT STANDARD) - if (debugConfiguration.python === '${command:python.interpreterPath}') { - // if python is set to the command, resolve it + // Resolve current python property + if (debugConfiguration.python === '${command:python.interpreterPath}' || !debugConfiguration.python) { + // if python is set to the command or undefined, resolve it this.pythonPathSource = PythonPathSource.settingsJson; debugConfiguration.python = resolvedInterpreterPath; - } else if (!debugConfiguration.python) { - // fallback to pythonPath if python undefined - this.pythonPathSource = PythonPathSource.settingsJson; - debugConfiguration.python = debugConfiguration.pythonPath; } else { // User provided explicit python path in launch.json this.pythonPathSource = PythonPathSource.launchJson; @@ -186,16 +167,12 @@ export abstract class BaseConfigurationResolver ); } - // STEP 3: Set debug adapter and launcher Python paths (backwards compatible) + // Set debug adapter and launcher Python paths this.setDebugComponentPythonPaths(debugConfiguration); - - // STEP 4: Clean up - remove the deprecated pythonPath property - delete debugConfiguration.pythonPath; } /** - * Sets debugAdapterPython and debugLauncherPython with backwards compatibility. - * Prefers pythonPath over python for these internal properties. + * Sets debugAdapterPython and debugLauncherPython. * * @param debugConfiguration The debug configuration to update */ @@ -208,20 +185,11 @@ export abstract class BaseConfigurationResolver debugConfiguration.debugLauncherPython === '${command:python.interpreterPath}' || debugConfiguration.debugLauncherPython === undefined; - // Default fallback path (prefer pythonPath for backwards compatibility) - const fallbackPath = debugConfiguration.pythonPath ?? debugConfiguration.python; - - if (debugConfiguration.pythonPath !== debugConfiguration.python) { - sendTelemetryEvent(EventName.DEPRECATED_CODE_PATH_USAGE, undefined, { - codePath: 'different_python_paths_in_debug_config', - }); - } - if (shouldSetDebugAdapter) { - debugConfiguration.debugAdapterPython = fallbackPath; + debugConfiguration.debugAdapterPython = debugConfiguration.python; } if (shouldSetDebugLauncher) { - debugConfiguration.debugLauncherPython = fallbackPath; + debugConfiguration.debugLauncherPython = debugConfiguration.python; } } diff --git a/src/extension/debugger/configuration/resolvers/launch.ts b/src/extension/debugger/configuration/resolvers/launch.ts index 89efe76a..8508e79c 100644 --- a/src/extension/debugger/configuration/resolvers/launch.ts +++ b/src/extension/debugger/configuration/resolvers/launch.ts @@ -68,17 +68,6 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver { - if (debugConfiguration.python === undefined) { - debugConfiguration.python = debugConfiguration.pythonPath; - } - if (debugConfiguration.debugAdapterPython === undefined) { - debugConfiguration.debugAdapterPython = debugConfiguration.pythonPath; - } - if (debugConfiguration.debugLauncherPython === undefined) { - debugConfiguration.debugLauncherPython = debugConfiguration.pythonPath; - } - delete debugConfiguration.pythonPath; - if (typeof debugConfiguration.cwd !== 'string' && workspaceFolder) { debugConfiguration.cwd = workspaceFolder.fsPath; }