add current open folder to new project quickpick (#20414)

* add open folder to new project quickpick

* swap so default save location is first
This commit is contained in:
Kim Santiago
2022-08-19 14:46:24 -07:00
committed by GitHub
parent c7ce98c4de
commit cb29eccef3

View File

@@ -49,9 +49,17 @@ export async function createNewProjectWithQuickpick(workspaceService: WorkspaceS
const defaultProjectSaveLoc = defaultProjectSaveLocation();
const browseProjectLocationOptions = [constants.BrowseEllipsisWithIcon];
// if there's an open folder, add it for easier access. If there are multiple folders in the workspace, default to the first one
if (vscode.workspace.workspaceFolders) {
browseProjectLocationOptions.unshift(vscode.workspace.workspaceFolders[0].uri.fsPath);
}
// add default project save location if it's been set
if (defaultProjectSaveLoc) {
browseProjectLocationOptions.unshift(defaultProjectSaveLoc.fsPath);
}
// 3. Prompt for Project location
// We validate that the folder doesn't already exist, and if it does keep prompting them to pick a new one
let projectLocation = '';