From e80c7142d5256e5246eae7a6ea0b5f84d5d39d1a Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 29 Sep 2025 16:11:02 -0400 Subject: [PATCH] Revert "update settings.json as default formatter as yaml" This reverts commit 84d45168f30348cd8c060a52488b743bd77ebea1. Fixes #1157 Adjusting the user settings automatically was annoying to some users. The main bug fix, which consisted of setting the document selector to include Docker Compose and GitHub Action files, will not be reverted. --- src/extension.ts | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 6d2f734d..1aac4523 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -6,7 +6,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { workspace, ExtensionContext, extensions, window, commands, Uri, ConfigurationTarget } from 'vscode'; +import { workspace, ExtensionContext, extensions, window, commands, Uri } from 'vscode'; import { CommonLanguageClient, LanguageClientOptions, @@ -161,7 +161,7 @@ export function startClient( findConflicts(); client .onReady() - .then(async () => { + .then(() => { // Send a notification to the server with any YAML schema associations in all extensions client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociations()); @@ -218,8 +218,6 @@ export function startClient( }); initializeRecommendation(context); - - await setDefaultFormatter(['dockercompose', 'github-actions-workflow']); }) .catch((err) => { sendStartupTelemetryEvent(runtime.telemetry, false, err); @@ -228,23 +226,6 @@ export function startClient( return schemaExtensionAPI; } -/** - * set redhat.vscode-yaml as default formatter - * @param extensions [dockercompose, github-actions-workflow] - */ -async function setDefaultFormatter(extensions: string[]): Promise { - const config = workspace.getConfiguration(); - extensions.forEach(async (extension) => { - const extensionConf = config.get>(`[${extension}]`) || {}; - if (extensionConf) { - if (extensionConf['editor.defaultFormatter'] === undefined) { - extensionConf['editor.defaultFormatter'] = 'redhat.vscode-yaml'; - await config.update(`[${extension}]`, extensionConf, ConfigurationTarget.Global); - } - } - }); -} - /** * Finds extensions that conflict with VSCode-YAML. * If one or more conflicts are found then show an uninstall notification