Fix: Open file browser at workspace root when selecting interpreter path#25520
Fix: Open file browser at workspace root when selecting interpreter path#25520eleanorjboyd merged 3 commits intomainfrom
Conversation
- Added defaultUri parameter to showOpenDialog to open at current workspace - Updated all related unit tests to include defaultUri in expected parameters - Added new test case to verify workspace URI is used as defaultUri Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
|
@copilot im confused here because it looks like you didn't really make a needed code change and only really changed a test. Please review and fix |
The code change is present in commit 549fd1a. The source file const uris = await this.applicationShell.showOpenDialog({
filters: this.platformService.isWindows ? filtersObject : undefined,
openLabel: InterpreterQuickPickList.browsePath.openButtonLabel,
canSelectMany: false,
title: InterpreterQuickPickList.browsePath.title,
defaultUri: state.workspace, // ← Added this line
});The line is also present in the compiled JavaScript output ( The |
Problem
When users click "Enter interpreter path..." and then select "Find..." to browse for a Python interpreter, the file browser dialog opens at the user's home directory instead of the current workspace root. This creates a frustrating experience when trying to navigate to virtual environments (like
.venv) or other interpreters located within the project directory.Solution
Added the
defaultUriparameter to theshowOpenDialogcall in the_enterOrBrowseInterpreterPathmethod. This parameter is set tostate.workspace, which contains the current workspace folder URI when a workspace is open.Impact
.venvfolders and project-specific interpretersTesting
defaultUriparameter in expected valuesBrowse...option is selected with workspace, file browser opens at workspace root"Fixes issue where users expected the file browser to open in their current project directory when browsing for interpreters, improving the user experience when setting up virtual environments in VS Code.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.comnode ./out/test/standardTest.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #25512
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.