From a63fc267e97e83c61e422e991c87d50fa2fe8e53 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 4 Jul 2025 18:14:12 +0530 Subject: [PATCH] fix multiple configs present --- extensions/vscode/src/activation/activate.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/extensions/vscode/src/activation/activate.ts b/extensions/vscode/src/activation/activate.ts index d364dc7b0..21f7fcb3f 100644 --- a/extensions/vscode/src/activation/activate.ts +++ b/extensions/vscode/src/activation/activate.ts @@ -24,8 +24,8 @@ export async function activateExtension(context: vscode.ExtensionContext) { // Load Continue configuration if (!context.globalState.get("hasBeenInstalled")) { - context.globalState.update("hasBeenInstalled", true); - Telemetry.capture( + void context.globalState.update("hasBeenInstalled", true); + void Telemetry.capture( "install", { extensionVersion: getExtensionVersion(), @@ -38,21 +38,15 @@ export async function activateExtension(context: vscode.ExtensionContext) { const yamlMatcher = ".continue/**/*.yaml"; const yamlConfig = vscode.workspace.getConfiguration("yaml"); - const existingSchemas = yamlConfig.get("schemas") || {}; - const newSchemas = Object.entries(existingSchemas).filter( - ([_, value]) => Array.isArray(value) && value.includes(yamlMatcher), // remove old ones - ); - const newPath = path.join( context.extension.extensionUri.fsPath, "config-yaml-schema.json", ); - newSchemas.push([newPath, [yamlMatcher]]); try { await yamlConfig.update( "schemas", - Object.fromEntries(newSchemas), + { [newPath]: [yamlMatcher] }, vscode.ConfigurationTarget.Global, ); } catch (error) {