Skip to content

Commit 4d73772

Browse files
bergmeisterTylerLeonhardt
authored andcommitted
Add new powershell.codeFormatting settings for new options in PSSA 1.18: PipelineIndentationStyle (#1669)
* Add powershell.codeformatting.pipelineIndentationStyle setting * fix indentation
1 parent 3ea87d8 commit 4d73772

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,16 @@
642642
"default": true,
643643
"description": "Adds a newline (line break) after a closing brace."
644644
},
645+
"powershell.codeFormatting.pipelineIndentationStyle": {
646+
"type": "string",
647+
"enum": [
648+
"IncreaseIndentationForFirstPipeline",
649+
"IncreaseIndentationAfterEveryPipeline",
650+
"NoIndentation"
651+
],
652+
"default": "IncreaseIndentationForFirstPipeline",
653+
"description": "Multi-line pipeline style settings."
654+
},
645655
"powershell.codeFormatting.whitespaceBeforeOpenBrace": {
646656
"type": "boolean",
647657
"default": true,

src/settings.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ enum CodeFormattingPreset {
1414
Stroustrup,
1515
}
1616

17+
enum PipelineIndentationStyle {
18+
IncreaseIndentationForFirstPipeline,
19+
IncreaseIndentationAfterEveryPipeline,
20+
NoIndentation,
21+
}
22+
1723
export enum HelpCompletion {
1824
Disabled = "Disabled",
1925
BlockComment = "BlockComment",
@@ -39,6 +45,7 @@ export interface ICodeFormattingSettings {
3945
openBraceOnSameLine: boolean;
4046
newLineAfterOpenBrace: boolean;
4147
newLineAfterCloseBrace: boolean;
48+
pipelineIndentationStyle: PipelineIndentationStyle;
4249
whitespaceBeforeOpenBrace: boolean;
4350
whitespaceBeforeOpenParen: boolean;
4451
whitespaceAroundOperator: boolean;
@@ -128,6 +135,7 @@ export function load(): ISettings {
128135
openBraceOnSameLine: true,
129136
newLineAfterOpenBrace: true,
130137
newLineAfterCloseBrace: true,
138+
pipelineIndentationStyle: PipelineIndentationStyle.IncreaseIndentationForFirstPipeline,
131139
whitespaceBeforeOpenBrace: true,
132140
whitespaceBeforeOpenParen: true,
133141
whitespaceAroundOperator: true,

0 commit comments

Comments
 (0)