Skip to content

Commit 816c37e

Browse files
committed
remove deprecated pythonPath config ref
1 parent a1d6e79 commit 816c37e

File tree

3 files changed

+8
-53
lines changed

3 files changed

+8
-53
lines changed

src/extension/debugger/adapter/factory.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
116116
): Promise<string[]> {
117117
if (configuration.debugAdapterPython !== undefined) {
118118
return this.getExecutableCommand(await resolveEnvironment(configuration.debugAdapterPython));
119-
} else if (configuration.pythonPath) {
120-
return this.getExecutableCommand(await resolveEnvironment(configuration.pythonPath));
121119
}
122120

123121
const resourceUri = workspaceFolder ? workspaceFolder.uri : undefined;

src/extension/debugger/configuration/resolvers/base.ts

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
125125
}
126126

127127
/**
128-
* Resolves Python interpreter paths and handles the legacy pythonPath deprecation.
128+
* Resolves Python interpreter paths.
129129
*
130130
* @param workspaceFolder The workspace folder URI for variable resolution and interpreter detection
131131
* @param debugConfiguration The launch configuration to update with resolved Python paths
@@ -145,37 +145,18 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
145145

146146
traceLog(
147147
`resolveAndUpdatePythonPath - Initial state: ` +
148-
`pythonPath='${debugConfiguration.pythonPath}', ` +
149148
`python='${debugConfiguration.python}', ` +
150149
`debugAdapterPython='${debugConfiguration.debugAdapterPython}', ` +
151150
`debugLauncherPython='${debugConfiguration.debugLauncherPython}', ` +
152151
`workspaceFolder='${workspaceFolder?.fsPath}'` +
153152
`resolvedInterpreterPath='${resolvedInterpreterPath}'`,
154153
);
155154

156-
// STEP 1: Resolve legacy pythonPath property (DEPRECATED)
157-
// pythonPath will equal user set value, or getInterpreterDetails if undefined or set to command
158-
if (debugConfiguration.pythonPath === '${command:python.interpreterPath}' || !debugConfiguration.pythonPath) {
159-
this.pythonPathSource = PythonPathSource.settingsJson;
160-
debugConfiguration.pythonPath = resolvedInterpreterPath;
161-
} else {
162-
// User provided explicit pythonPath in launch.json
163-
debugConfiguration.pythonPath = resolveWorkspaceVariables(
164-
debugConfiguration.pythonPath,
165-
workspaceFolder?.fsPath,
166-
undefined,
167-
);
168-
}
169-
170-
// STEP 2: Resolve current python property (CURRENT STANDARD)
171-
if (debugConfiguration.python === '${command:python.interpreterPath}') {
172-
// if python is set to the command, resolve it
155+
// Resolve current python property
156+
if (debugConfiguration.python === '${command:python.interpreterPath}' || !debugConfiguration.python) {
157+
// if python is set to the command or undefined, resolve it
173158
this.pythonPathSource = PythonPathSource.settingsJson;
174159
debugConfiguration.python = resolvedInterpreterPath;
175-
} else if (!debugConfiguration.python) {
176-
// fallback to pythonPath if python undefined
177-
this.pythonPathSource = PythonPathSource.settingsJson;
178-
debugConfiguration.python = debugConfiguration.pythonPath;
179160
} else {
180161
// User provided explicit python path in launch.json
181162
this.pythonPathSource = PythonPathSource.launchJson;
@@ -186,16 +167,12 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
186167
);
187168
}
188169

189-
// STEP 3: Set debug adapter and launcher Python paths (backwards compatible)
170+
// Set debug adapter and launcher Python paths
190171
this.setDebugComponentPythonPaths(debugConfiguration);
191-
192-
// STEP 4: Clean up - remove the deprecated pythonPath property
193-
delete debugConfiguration.pythonPath;
194172
}
195173

196174
/**
197-
* Sets debugAdapterPython and debugLauncherPython with backwards compatibility.
198-
* Prefers pythonPath over python for these internal properties.
175+
* Sets debugAdapterPython and debugLauncherPython.
199176
*
200177
* @param debugConfiguration The debug configuration to update
201178
*/
@@ -208,20 +185,11 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
208185
debugConfiguration.debugLauncherPython === '${command:python.interpreterPath}' ||
209186
debugConfiguration.debugLauncherPython === undefined;
210187

211-
// Default fallback path (prefer pythonPath for backwards compatibility)
212-
const fallbackPath = debugConfiguration.pythonPath ?? debugConfiguration.python;
213-
214-
if (debugConfiguration.pythonPath !== debugConfiguration.python) {
215-
sendTelemetryEvent(EventName.DEPRECATED_CODE_PATH_USAGE, undefined, {
216-
codePath: 'different_python_paths_in_debug_config',
217-
});
218-
}
219-
220188
if (shouldSetDebugAdapter) {
221-
debugConfiguration.debugAdapterPython = fallbackPath;
189+
debugConfiguration.debugAdapterPython = debugConfiguration.python;
222190
}
223191
if (shouldSetDebugLauncher) {
224-
debugConfiguration.debugLauncherPython = fallbackPath;
192+
debugConfiguration.debugLauncherPython = debugConfiguration.python;
225193
}
226194
}
227195

src/extension/debugger/configuration/resolvers/launch.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,6 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
6868
workspaceFolder: Uri | undefined,
6969
debugConfiguration: LaunchRequestArguments,
7070
): Promise<void> {
71-
if (debugConfiguration.python === undefined) {
72-
debugConfiguration.python = debugConfiguration.pythonPath;
73-
}
74-
if (debugConfiguration.debugAdapterPython === undefined) {
75-
debugConfiguration.debugAdapterPython = debugConfiguration.pythonPath;
76-
}
77-
if (debugConfiguration.debugLauncherPython === undefined) {
78-
debugConfiguration.debugLauncherPython = debugConfiguration.pythonPath;
79-
}
80-
delete debugConfiguration.pythonPath;
81-
8271
if (typeof debugConfiguration.cwd !== 'string' && workspaceFolder) {
8372
debugConfiguration.cwd = workspaceFolder.fsPath;
8473
}

0 commit comments

Comments
 (0)