From 9f59b8875ae350ced5b41f0980e6576cb598c26c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Sep 2025 22:23:29 +0000 Subject: [PATCH] Fix VS Code settings merge to preserve existing chat configurations Co-authored-by: AstroSteveo <34114851+AstroSteveo@users.noreply.github.com> --- initialize-project.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/initialize-project.js b/initialize-project.js index bf89b7a..8e19474 100644 --- a/initialize-project.js +++ b/initialize-project.js @@ -75,8 +75,16 @@ function createVSCodeSettings() { } } - // Merge awesome-copilot settings - Object.assign(settings, awesomeCopilotSettings); + // Deep merge awesome-copilot settings to preserve existing chat settings + for (const [key, value] of Object.entries(awesomeCopilotSettings)) { + if (settings[key] && typeof settings[key] === 'object' && typeof value === 'object') { + // If both the existing setting and new setting are objects, merge them + settings[key] = { ...settings[key], ...value }; + } else { + // Otherwise, set the new value + settings[key] = value; + } + } // Write settings back fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2));