Skip to content

Commit 26c58ad

Browse files
committed
Simplify choosing a recent folder
We can just use the selected value directly.
1 parent 28e11df commit 26c58ad

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/commands.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -407,19 +407,14 @@ async function openWorkspace(
407407
if (opened.length === 1 || (opened.length > 1 && openRecent)) {
408408
folderPath = opened[0].folderUri.path
409409
} else if (opened.length > 1) {
410-
const items = opened.map<vscode.QuickPickItem>((folder) => {
411-
return {
412-
label: folder.folderUri.path,
413-
}
414-
})
415-
const item = await vscode.window.showQuickPick(items, {
410+
const items = opened.map((f) => f.folderUri.path)
411+
folderPath = await vscode.window.showQuickPick(items, {
416412
title: "Select a recently opened folder",
417413
})
418-
if (!item) {
414+
if (!folderPath) {
419415
// User aborted.
420416
return
421417
}
422-
folderPath = opened[items.indexOf(item)].folderUri.path
423418
}
424419
}
425420

0 commit comments

Comments
 (0)