Skip to content

Commit 124e1f7

Browse files
bergmeisterChristoph Bergmeister (MVP)
authored and
Christoph Bergmeister (MVP)
committed
Add new powershell.codeFormatting settings for new options in PSSA 1.18: PipelineIndentationStyle (#1669)
* Add powershell.codeformatting.pipelineIndentationStyle setting * fix indentation
1 parent c940267 commit 124e1f7

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

package.json

+10
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,16 @@
637637
"default": true,
638638
"description": "Adds a newline (line break) after a closing brace."
639639
},
640+
"powershell.codeFormatting.pipelineIndentationStyle": {
641+
"type": "string",
642+
"enum": [
643+
"IncreaseIndentationForFirstPipeline",
644+
"IncreaseIndentationAfterEveryPipeline",
645+
"NoIndentation"
646+
],
647+
"default": "IncreaseIndentationForFirstPipeline",
648+
"description": "Multi-line pipeline style settings."
649+
},
640650
"powershell.codeFormatting.whitespaceBeforeOpenBrace": {
641651
"type": "boolean",
642652
"default": true,

src/settings.ts

+8
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;
@@ -125,6 +132,7 @@ export function load(): ISettings {
125132
openBraceOnSameLine: true,
126133
newLineAfterOpenBrace: true,
127134
newLineAfterCloseBrace: true,
135+
pipelineIndentationStyle: PipelineIndentationStyle.IncreaseIndentationForFirstPipeline,
128136
whitespaceBeforeOpenBrace: true,
129137
whitespaceBeforeOpenParen: true,
130138
whitespaceAroundOperator: true,

0 commit comments

Comments
 (0)