From db63f389f3b6faffc868545a08c5e10a1fdba2ed Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Jan 2024 08:37:19 -0800 Subject: [PATCH 1/2] deprecate boolean in setting, shows warning, still allows true for now --- .../codeActions/browser/codeActionsContribution.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts b/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts index 70ca709c5beb5..d30d24f756a8d 100644 --- a/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts +++ b/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts @@ -19,8 +19,8 @@ import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensi const createCodeActionsAutoSave = (description: string): IJSONSchema => { return { - type: ['string', 'boolean'], - enum: ['always', 'explicit', 'never', true, false], + type: 'string', + enum: ['always', 'explicit', 'never'], enumDescriptions: [ nls.localize('alwaysSave', 'Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes.'), nls.localize('explicitSave', 'Triggers Code Actions only when explicitly saved'), @@ -43,7 +43,7 @@ const codeActionsOnSaveSchema: IConfigurationPropertySchema = { type: 'object', properties: codeActionsOnSaveDefaultProperties, additionalProperties: { - type: ['string', 'boolean'] + type: 'string' }, }, { @@ -54,8 +54,8 @@ const codeActionsOnSaveSchema: IConfigurationPropertySchema = { markdownDescription: nls.localize('editor.codeActionsOnSave', 'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'), type: ['object', 'array'], additionalProperties: { - type: ['string', 'boolean'], - enum: ['always', 'explicit', 'never', true, false], + type: 'string', + enum: ['always', 'explicit', 'never'], }, default: {}, scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, From 37978c599f33158f9987c40901b0a79734bdcad7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Jan 2024 08:43:22 -0800 Subject: [PATCH 2/2] change default value --- .../contrib/codeActions/browser/codeActionsContribution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts b/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts index d30d24f756a8d..4225ffa7cd7d9 100644 --- a/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts +++ b/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.ts @@ -20,7 +20,7 @@ import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensi const createCodeActionsAutoSave = (description: string): IJSONSchema => { return { type: 'string', - enum: ['always', 'explicit', 'never'], + enum: ['always', 'explicit', 'never', true, false], enumDescriptions: [ nls.localize('alwaysSave', 'Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes.'), nls.localize('explicitSave', 'Triggers Code Actions only when explicitly saved'), @@ -28,7 +28,7 @@ const createCodeActionsAutoSave = (description: string): IJSONSchema => { nls.localize('explicitSaveBoolean', 'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'), nls.localize('neverSaveBoolean', 'Never triggers Code Actions on save. This value will be deprecated in favor of "never".') ], - default: true, + default: 'explicit', description: description }; }; @@ -55,7 +55,7 @@ const codeActionsOnSaveSchema: IConfigurationPropertySchema = { type: ['object', 'array'], additionalProperties: { type: 'string', - enum: ['always', 'explicit', 'never'], + enum: ['always', 'explicit', 'never', true, false], }, default: {}, scope: ConfigurationScope.LANGUAGE_OVERRIDABLE,