Change:
private async addOrRemoveWorkspaceFolderRecommendation(extensionId: string, workspaceFolder: IWorkspaceFolder, extensionsConfigContent: IExtensionsConfigContent, add: boolean): Promise<void> { const values: IJSONValue[] = []; if (add) { <del> values.push({ path: ['recommendations'], value: [...extensionsConfigContent.recommendations || [], extensionId] }); if (extensionsConfigContent.unwantedRecommendations && extensionsConfigContent.unwantedRecommendations.some(e => e === extensionId)) { values.push({ path: ['unwantedRecommendations'], value: extensionsConfigContent.unwantedRecommendations.filter(e => e !== extensionId) }); </del> <ins> if (Array.isArray(extensionsConfigContent.recommendations)) { values.push({ path: ['recommendations', -1], value: extensionId }); } else { values.push({ path: ['recommendations'], value: [extensionId] }); } const unwantedRecommendationEdit = this.getEditToRemoveValueFromArray(['unwantedRecommendations'], extensionsConfigContent.unwantedRecommendations, extensionId); if (unwantedRecommendationEdit) { values.push(unwantedRecommendationEdit); </ins> } } else if (extensionsConfigContent.recommendations) { <del> values.push({ path: ['recommendations'], value: extensionsConfigContent.recommendations.filter(e => e !== extensionId) }); </del> <ins> const recommendationEdit = this.getEditToRemoveValueFromArray(['recommendations'], extensionsConfigContent.recommendations, extensionId); if (recommendationEdit) { values.push(recommendationEdit); } </ins> } if (values.length) {

Discussion:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: Version: 1.84.0 (system setup) OS: WindowsNT x64 10.0. Steps to Reproduce: "Add to Workspace Recommendations" any extension and select whichever place you like (i.e. among workspace & workspace folder) the or some comments inside_ the array once step 1. the comment from step 3. got erased. <!-- -- Titles & summaries: "add to rec" removes comments from extensions-recommendations array in the configuration file "add to rec" rewrites & hence erases any comments in extensions-recommendations array "add to rec" rewrites & hence erases any comments in Sample file:
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.84.2. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding!
i wish there were patch updates if i have to update that frequently
p.s.: wow, never tried doing it from command palette pps: i think that no longer exists now
thanks all a lot