From 3b70926f7a8358403f1f6433c94e1c9f7e7a5c88 Mon Sep 17 00:00:00 2001 From: "Sparsh :)" <76697238+SparshGarg999@users.noreply.github.com> Date: Mon, 6 Jul 2026 14:06:02 +0530 Subject: [PATCH 1/2] Check if redhat.vscode-yaml is installed before editing yaml.schemas configuration --- extensions/vscode/src/activation/activate.ts | 45 +++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/extensions/vscode/src/activation/activate.ts b/extensions/vscode/src/activation/activate.ts index 8aef69fdcf6..39539c50d3c 100644 --- a/extensions/vscode/src/activation/activate.ts +++ b/extensions/vscode/src/activation/activate.ts @@ -39,29 +39,32 @@ export async function activateExtension(context: vscode.ExtensionContext) { } // Register config.yaml schema by removing old entries and adding new one (uri.fsPath changes with each version) - const yamlMatcher = ".continue/**/*.yaml"; - const yamlConfig = vscode.workspace.getConfiguration("yaml"); - const yamlSchemas = yamlConfig.get("schemas", {}); + const yamlExtension = vscode.extensions.getExtension("redhat.vscode-yaml"); + if (yamlExtension) { + const yamlMatcher = ".continue/**/*.yaml"; + const yamlConfig = vscode.workspace.getConfiguration("yaml"); + const yamlSchemas = yamlConfig.get("schemas", {}); - const newPath = vscode.Uri.joinPath( - context.extension.extensionUri, - "config-yaml-schema.json", - ).toString(); + const newPath = vscode.Uri.joinPath( + context.extension.extensionUri, + "config-yaml-schema.json", + ).toString(); - try { - await yamlConfig.update( - "schemas", - { - ...yamlSchemas, - [newPath]: [yamlMatcher], - }, - vscode.ConfigurationTarget.Global, - ); - } catch (error) { - console.error( - "Failed to register Continue config.yaml schema, most likely, YAML extension is not installed", - error, - ); + try { + await yamlConfig.update( + "schemas", + { + ...yamlSchemas, + [newPath]: [yamlMatcher], + }, + vscode.ConfigurationTarget.Global, + ); + } catch (error) { + console.error( + "Failed to register Continue config.yaml schema", + error, + ); + } } const api = new VsCodeContinueApi(vscodeExtension); From 44c28630452620a04063c6287325df07e41c5866 Mon Sep 17 00:00:00 2001 From: "Sparsh :)" <76697238+SparshGarg999@users.noreply.github.com> Date: Mon, 6 Jul 2026 21:00:34 +0530 Subject: [PATCH 2/2] Format yaml extension check file with prettier --- extensions/vscode/src/activation/activate.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/extensions/vscode/src/activation/activate.ts b/extensions/vscode/src/activation/activate.ts index 39539c50d3c..c166bd3517f 100644 --- a/extensions/vscode/src/activation/activate.ts +++ b/extensions/vscode/src/activation/activate.ts @@ -60,10 +60,7 @@ export async function activateExtension(context: vscode.ExtensionContext) { vscode.ConfigurationTarget.Global, ); } catch (error) { - console.error( - "Failed to register Continue config.yaml schema", - error, - ); + console.error("Failed to register Continue config.yaml schema", error); } }