From 5ef03b7fdc39bfd36095ccf1022130003a8ae5f3 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 23 Jul 2020 20:24:10 +0100 Subject: [PATCH] When migrating old whitespaceAroundPipe setting to AddWhitespaceAroundPipe, remove old setting now --- package.json | 5 +++++ src/session.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b903535ed5..acae7cf791 100644 --- a/package.json +++ b/package.json @@ -801,6 +801,11 @@ "default": false, "description": "Removes redundant whitespace between parameters." }, + "powershell.codeFormatting.whitespaceAroundPipe": { + "type": "boolean", + "default": true, + "description": "REMOVED. Please use the \"powershell.codeFormatting.addWhitespaceAroundPipe\" setting instead. If you've used this setting before, we have moved it for you automatically." + }, "powershell.codeFormatting.addWhitespaceAroundPipe": { "type": "boolean", "default": true, diff --git a/src/session.ts b/src/session.ts index 9e9ca64260..6f9f8e4b57 100644 --- a/src/session.ts +++ b/src/session.ts @@ -326,8 +326,7 @@ export class SessionManager implements Middleware { return resolvedCodeLens; } - // During preview, populate a new setting value but not remove the old value. - // TODO: When the next stable extension releases, then the old value can be safely removed. Tracked in this issue: https://github.com/PowerShell/vscode-powershell/issues/2693 + // Move old setting codeFormatting.whitespaceAroundPipe to new setting codeFormatting.addWhitespaceAroundPipe private async migrateWhitespaceAroundPipeSetting() { const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId); const deprecatedSetting = 'codeFormatting.whitespaceAroundPipe' @@ -337,6 +336,7 @@ export class SessionManager implements Middleware { const configurationTarget = await Settings.getEffectiveConfigurationTarget(deprecatedSetting); const value = configuration.get(deprecatedSetting, configurationTarget) await Settings.change(newSetting, value, configurationTarget); + await Settings.change(deprecatedSetting, undefined, configurationTarget); } }