Skip to content

Commit 3ea87d8

Browse files
Add new powershell.codeFormatting settings for new options in PSSA 1.18: WhitespaceInsideBrace and WhitespaceAroundPipe (#1668)
* Add new settings: powershell.codeFormatting.WhitespaceInsideBrace and powershell.codeFormatting.WhitespaceAroundPipe * fix whitespace * Apply suggestions from code review
2 parents 4c826b3 + 823e558 commit 3ea87d8

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
@@ -662,6 +662,16 @@
662662
"default": true,
663663
"description": "Adds a space after a separator (',' and ';')."
664664
},
665+
"powershell.codeFormatting.WhitespaceInsideBrace": {
666+
"type": "boolean",
667+
"default": true,
668+
"description": "Adds a space after an opening brace ('{') and before a closing brace ('}')."
669+
},
670+
"powershell.codeFormatting.WhitespaceAroundPipe": {
671+
"type": "boolean",
672+
"default": true,
673+
"description": "Adds a space before and after the pipeline operator ('|')."
674+
},
665675
"powershell.codeFormatting.ignoreOneLineBlock": {
666676
"type": "boolean",
667677
"default": true,

src/settings.ts

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export interface ICodeFormattingSettings {
4343
whitespaceBeforeOpenParen: boolean;
4444
whitespaceAroundOperator: boolean;
4545
whitespaceAfterSeparator: boolean;
46+
WhitespaceInsideBrace: true;
47+
WhitespaceAroundPipe: true;
4648
ignoreOneLineBlock: boolean;
4749
alignPropertyValuePairs: boolean;
4850
useCorrectCasing: boolean;
@@ -130,6 +132,8 @@ export function load(): ISettings {
130132
whitespaceBeforeOpenParen: true,
131133
whitespaceAroundOperator: true,
132134
whitespaceAfterSeparator: true,
135+
WhitespaceInsideBrace: true,
136+
WhitespaceAroundPipe: true,
133137
ignoreOneLineBlock: true,
134138
alignPropertyValuePairs: true,
135139
useCorrectCasing: true,

0 commit comments

Comments
 (0)