Skip to content

Commit 971f766

Browse files
TylerLeonhardtChristoph Bergmeister (MVP)
authored and
Christoph Bergmeister (MVP)
committed
Add new powershell.codeFormatting settings for new options in PSSA 1.18: WhitespaceInsideBrace and WhitespaceAroundPipe (PowerShell#1668)
* Add new settings: powershell.codeFormatting.WhitespaceInsideBrace and powershell.codeFormatting.WhitespaceAroundPipe * fix whitespace * Apply suggestions from code review
1 parent 124e1f7 commit 971f766

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

package.json

+10
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,16 @@
667667
"default": true,
668668
"description": "Adds a space after a separator (',' and ';')."
669669
},
670+
"powershell.codeFormatting.WhitespaceInsideBrace": {
671+
"type": "boolean",
672+
"default": true,
673+
"description": "Adds a space after an opening brace ('{') and before a closing brace ('}')."
674+
},
675+
"powershell.codeFormatting.WhitespaceAroundPipe": {
676+
"type": "boolean",
677+
"default": true,
678+
"description": "Adds a space before and after the pipeline operator ('|')."
679+
},
670680
"powershell.codeFormatting.ignoreOneLineBlock": {
671681
"type": "boolean",
672682
"default": true,

src/settings.ts

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export interface ICodeFormattingSettings {
5050
whitespaceBeforeOpenParen: boolean;
5151
whitespaceAroundOperator: boolean;
5252
whitespaceAfterSeparator: boolean;
53+
WhitespaceInsideBrace: true;
54+
WhitespaceAroundPipe: true;
5355
ignoreOneLineBlock: boolean;
5456
alignPropertyValuePairs: boolean;
5557
}
@@ -137,6 +139,8 @@ export function load(): ISettings {
137139
whitespaceBeforeOpenParen: true,
138140
whitespaceAroundOperator: true,
139141
whitespaceAfterSeparator: true,
142+
WhitespaceInsideBrace: true,
143+
WhitespaceAroundPipe: true,
140144
ignoreOneLineBlock: true,
141145
alignPropertyValuePairs: true,
142146
};

0 commit comments

Comments
 (0)