Skip to content

Commit 6356447

Browse files
authored
Merge pull request microsoft#250875 from microsoft/copilot/fix-250874
Fix syntax error in quickPickPin.ts causing pin recent command to throw
2 parents 177a6ea + e7fe0ed commit 6356447

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/vs/platform/quickinput/browser/quickPickPin.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function _formatPinnedItems(storageKey: string, quickPick: IQuickPick<IQuickPick
7777
}
7878

7979
function getItemIdentifier(item: QuickPickItem): string {
80-
return item.type === 'separator' ? '' : item.id || `${item.label}${item.description}${item.detail}}`;
80+
return item.type === 'separator' ? '' : item.id || `${item.label}${item.description}${item.detail}`;
8181
}
8282

8383
function updateButtons(item: QuickPickItem, removePin: boolean): void {
@@ -107,11 +107,19 @@ function updatePinnedItems(storageKey: string, changedItem: IQuickPickItem, stor
107107
} else {
108108
items.push(changedItem);
109109
}
110-
storageService.store(storageKey, JSON.stringify(items), StorageScope.WORKSPACE, StorageTarget.MACHINE);
110+
storageService.store(storageKey, JSON.stringify(items.map(formatPinnedItemForStorage)), StorageScope.WORKSPACE, StorageTarget.MACHINE);
111111
return items;
112112
}
113113

114114
function getPinnedItems(storageKey: string, storageService: IStorageService): IQuickPickItem[] {
115115
const items = storageService.get(storageKey, StorageScope.WORKSPACE);
116116
return items ? JSON.parse(items) : [];
117117
}
118+
119+
function formatPinnedItemForStorage(item: IQuickPickItem): IQuickPickItem {
120+
return {
121+
label: item.label,
122+
description: item.description,
123+
detail: item.detail,
124+
};
125+
}

0 commit comments

Comments
 (0)