Skip to content

Commit 8724148

Browse files
authored
fix reveal for venv creation (#580)
previous PR was incorrect, this one correctly handles #553
1 parent 5a2439a commit 8724148

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/managers/builtin/venvManager.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,20 @@ export class VenvManager implements EnvironmentManager {
196196
}
197197

198198
// Open the parent folder of the venv in the current window immediately after creation
199-
const envParent = path.dirname(environment.sysPrefix);
199+
const envParent = environment.sysPrefix;
200200
try {
201-
await commands.executeCommand('vscode.openFolder', Uri.file(envParent), {
202-
forceNewWindow: false,
203-
});
201+
await commands.executeCommand('revealInExplorer', Uri.file(envParent));
204202
} catch (error) {
205203
showErrorMessage(
206-
l10n.t('Failed to open venv parent folder: but venv was still created in {0}', envParent),
204+
l10n.t(
205+
'Failed to reveal venv parent folder in VS Code Explorer: but venv was still created in {0}',
206+
envParent,
207+
),
207208
);
208209
traceError(
209-
`Failed to open venv parent folder: ${error instanceof Error ? error.message : String(error)}`,
210+
`Failed to reveal venv parent folder in VS Code Explorer: ${
211+
error instanceof Error ? error.message : String(error)
212+
}`,
210213
);
211214
}
212215
}

0 commit comments

Comments
 (0)