Skip to content

Commit 7460e46

Browse files
bergmeisterChristoph Bergmeister
and
Christoph Bergmeister
authored
When migrating old whitespaceAroundPipe setting to AddWhitespaceAroundPipe, remove old setting now (#2830)
Co-authored-by: Christoph Bergmeister <christoph.bergmeister@bjss.com>
1 parent 7e29af3 commit 7460e46

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,11 @@
801801
"default": false,
802802
"description": "Removes redundant whitespace between parameters."
803803
},
804+
"powershell.codeFormatting.whitespaceAroundPipe": {
805+
"type": "boolean",
806+
"default": true,
807+
"description": "REMOVED. Please use the \"powershell.codeFormatting.addWhitespaceAroundPipe\" setting instead. If you've used this setting before, we have moved it for you automatically."
808+
},
804809
"powershell.codeFormatting.addWhitespaceAroundPipe": {
805810
"type": "boolean",
806811
"default": true,

src/session.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ export class SessionManager implements Middleware {
326326
return resolvedCodeLens;
327327
}
328328

329-
// During preview, populate a new setting value but not remove the old value.
330-
// 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
329+
// Move old setting codeFormatting.whitespaceAroundPipe to new setting codeFormatting.addWhitespaceAroundPipe
331330
private async migrateWhitespaceAroundPipeSetting() {
332331
const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId);
333332
const deprecatedSetting = 'codeFormatting.whitespaceAroundPipe'
@@ -337,6 +336,7 @@ export class SessionManager implements Middleware {
337336
const configurationTarget = await Settings.getEffectiveConfigurationTarget(deprecatedSetting);
338337
const value = configuration.get(deprecatedSetting, configurationTarget)
339338
await Settings.change(newSetting, value, configurationTarget);
339+
await Settings.change(deprecatedSetting, undefined, configurationTarget);
340340
}
341341
}
342342

0 commit comments

Comments
 (0)