Skip to content

Commit 60e5648

Browse files
bergmeisterChristoph Bergmeister
and
Christoph Bergmeister
authored
PSSA 1.19.0 settings (#2674)
* PSSA 1.19.0 settings support * add whitespaceBetweenParameters and change default pipeline indentation to None * add None option and set default Co-authored-by: Christoph Bergmeister <christoph.bergmeister@bjss.com>
1 parent d8e3ceb commit 60e5648

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,11 @@
654654
"enum": [
655655
"IncreaseIndentationForFirstPipeline",
656656
"IncreaseIndentationAfterEveryPipeline",
657-
"NoIndentation"
657+
"NoIndentation",
658+
"None"
658659
],
659-
"default": "NoIndentation",
660-
"description": "Multi-line pipeline style settings."
660+
"default": "None",
661+
"description": "Multi-line pipeline style settings (default: None)."
661662
},
662663
"powershell.codeFormatting.whitespaceBeforeOpenBrace": {
663664
"type": "boolean",
@@ -684,10 +685,20 @@
684685
"default": true,
685686
"description": "Adds a space after an opening brace ('{') and before a closing brace ('}')."
686687
},
687-
"powershell.codeFormatting.whitespaceAroundPipe": {
688+
"powershell.codeFormatting.whitespaceBetweenParameters": {
689+
"type": "boolean",
690+
"default": false,
691+
"description": "Removes redundant whitespace between parameters."
692+
},
693+
"powershell.codeFormatting.addWhitespaceAroundPipe": {
688694
"type": "boolean",
689695
"default": true,
690-
"description": "Adds a space before and after the pipeline operator ('|')."
696+
"description": "Adds a space before and after the pipeline operator ('|') if it is missing."
697+
},
698+
"powershell.codeFormatting.trimWhitespaceAroundPipe": {
699+
"type": "boolean",
700+
"default": false,
701+
"description": "Trims extraneous whitespace (more than 1 character) before and after the pipeline operator ('|')."
691702
},
692703
"powershell.codeFormatting.ignoreOneLineBlock": {
693704
"type": "boolean",

src/settings.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ enum PipelineIndentationStyle {
1818
IncreaseIndentationForFirstPipeline,
1919
IncreaseIndentationAfterEveryPipeline,
2020
NoIndentation,
21+
None,
2122
}
2223

2324
export enum HelpCompletion {
@@ -51,8 +52,10 @@ export interface ICodeFormattingSettings {
5152
whitespaceBeforeOpenParen: boolean;
5253
whitespaceAroundOperator: boolean;
5354
whitespaceAfterSeparator: boolean;
54-
whitespaceInsideBrace: true;
55-
whitespaceAroundPipe: true;
55+
whitespaceBetweenParameters: boolean;
56+
whitespaceInsideBrace: boolean;
57+
addWhitespaceAroundPipe: boolean;
58+
trimWhitespaceAroundPipe: boolean;
5659
ignoreOneLineBlock: boolean;
5760
alignPropertyValuePairs: boolean;
5861
useCorrectCasing: boolean;
@@ -158,13 +161,15 @@ export function load(): ISettings {
158161
openBraceOnSameLine: true,
159162
newLineAfterOpenBrace: true,
160163
newLineAfterCloseBrace: true,
161-
pipelineIndentationStyle: PipelineIndentationStyle.NoIndentation,
164+
pipelineIndentationStyle: PipelineIndentationStyle.None,
162165
whitespaceBeforeOpenBrace: true,
163166
whitespaceBeforeOpenParen: true,
164167
whitespaceAroundOperator: true,
165168
whitespaceAfterSeparator: true,
169+
whitespaceBetweenParameters: false,
166170
whitespaceInsideBrace: true,
167-
whitespaceAroundPipe: true,
171+
addWhitespaceAroundPipe: true,
172+
trimWhitespaceAroundPipe: false,
168173
ignoreOneLineBlock: true,
169174
alignPropertyValuePairs: true,
170175
useCorrectCasing: false,

0 commit comments

Comments
 (0)