Skip to content

Commit 8155aae

Browse files
committed
bug: fix path resolution to use resolved environment directly from setting
1 parent dab7bc9 commit 8155aae

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

src/features/interpreterSelection.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -391,28 +391,12 @@ async function tryResolveInterpreterPath(
391391
}
392392

393393
if (manager && resolvedEnv) {
394-
// Create a wrapper environment that uses the user's specified path
395-
const newEnv: PythonEnvironment = {
396-
envId: {
397-
id: `defaultInterpreterPath:${interpreterPath}`,
398-
managerId: manager.id,
399-
},
400-
name: 'defaultInterpreterPath: ' + (resolved.version ?? ''),
401-
displayName: 'defaultInterpreterPath: ' + (resolved.version ?? ''),
402-
version: resolved.version ?? '',
403-
displayPath: interpreterPath,
404-
environmentPath: Uri.file(interpreterPath),
405-
sysPrefix: resolved.prefix ?? '',
406-
execInfo: {
407-
run: {
408-
executable: interpreterPath,
409-
},
410-
},
411-
};
394+
// Use the resolved environment directly - it has the canonical ID format
395+
// The 'source' field tracks that this came from defaultInterpreterPath setting
412396
traceVerbose(
413-
`[tryResolveInterpreterPath] Resolved '${interpreterPath}' to ${resolved.executable} (${resolved.version})`,
397+
`[tryResolveInterpreterPath] Resolved '${interpreterPath}' to ${resolved.executable} (${resolved.version}) with ID ${resolvedEnv.envId.id}`,
414398
);
415-
return { manager, environment: newEnv, source: 'defaultInterpreterPath' };
399+
return { manager, environment: resolvedEnv, source: 'defaultInterpreterPath' };
416400
}
417401
}
418402
traceVerbose(

0 commit comments

Comments
 (0)