From cb29eccef3342017973b7fe2558a16df68213b45 Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Fri, 19 Aug 2022 14:46:24 -0700 Subject: [PATCH] add current open folder to new project quickpick (#20414) * add open folder to new project quickpick * swap so default save location is first --- .../data-workspace/src/dialogs/newProjectQuickpick.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/data-workspace/src/dialogs/newProjectQuickpick.ts b/extensions/data-workspace/src/dialogs/newProjectQuickpick.ts index 9d6ffe348a..1a1cc46856 100644 --- a/extensions/data-workspace/src/dialogs/newProjectQuickpick.ts +++ b/extensions/data-workspace/src/dialogs/newProjectQuickpick.ts @@ -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 = '';