Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Simplify choosing a recent folder
We can just use the selected value directly.
  • Loading branch information
code-asher committed May 20, 2024
commit 26c58adf53f1a81228860b64a9a89e4a724a7a7e
11 changes: 3 additions & 8 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,19 +407,14 @@ async function openWorkspace(
if (opened.length === 1 || (opened.length > 1 && openRecent)) {
folderPath = opened[0].folderUri.path
} else if (opened.length > 1) {
const items = opened.map<vscode.QuickPickItem>((folder) => {
return {
label: folder.folderUri.path,
}
})
const item = await vscode.window.showQuickPick(items, {
const items = opened.map((f) => f.folderUri.path)
folderPath = await vscode.window.showQuickPick(items, {
title: "Select a recently opened folder",
})
if (!item) {
if (!folderPath) {
// User aborted.
return
}
folderPath = opened[items.indexOf(item)].folderUri.path
}
}

Expand Down