Skip to content

Commit 94ac0bd

Browse files
Merge pull request #1805 from bergmeister/backportPSSASettings
Backport PSSA 1.18.0 PRs
2 parents c940267 + 86a7c23 commit 94ac0bd

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

package.json

+25
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,
@@ -657,6 +667,16 @@
657667
"default": true,
658668
"description": "Adds a space after a separator (',' and ';')."
659669
},
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+
},
660680
"powershell.codeFormatting.ignoreOneLineBlock": {
661681
"type": "boolean",
662682
"default": true,
@@ -667,6 +687,11 @@
667687
"default": true,
668688
"description": "Align assignment statements in a hashtable or a DSC Configuration."
669689
},
690+
"powershell.codeFormatting.useCorrectCasing": {
691+
"type": "boolean",
692+
"default": true,
693+
"description": "Use correct casing for cmdlets."
694+
},
670695
"powershell.integratedConsole.showOnStartup": {
671696
"type": "boolean",
672697
"default": true,

src/settings.ts

+14
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,12 +45,16 @@ export interface ICodeFormattingSettings {
3945
openBraceOnSameLine: boolean;
4046
newLineAfterOpenBrace: boolean;
4147
newLineAfterCloseBrace: boolean;
48+
pipelineIndentationStyle: PipelineIndentationStyle;
4249
whitespaceBeforeOpenBrace: boolean;
4350
whitespaceBeforeOpenParen: boolean;
4451
whitespaceAroundOperator: boolean;
4552
whitespaceAfterSeparator: boolean;
53+
WhitespaceInsideBrace: true;
54+
WhitespaceAroundPipe: true;
4655
ignoreOneLineBlock: boolean;
4756
alignPropertyValuePairs: boolean;
57+
useCorrectCasing: boolean;
4858
}
4959

5060
export interface IScriptAnalysisSettings {
@@ -125,12 +135,16 @@ export function load(): ISettings {
125135
openBraceOnSameLine: true,
126136
newLineAfterOpenBrace: true,
127137
newLineAfterCloseBrace: true,
138+
pipelineIndentationStyle: PipelineIndentationStyle.IncreaseIndentationForFirstPipeline,
128139
whitespaceBeforeOpenBrace: true,
129140
whitespaceBeforeOpenParen: true,
130141
whitespaceAroundOperator: true,
131142
whitespaceAfterSeparator: true,
143+
WhitespaceInsideBrace: true,
144+
WhitespaceAroundPipe: true,
132145
ignoreOneLineBlock: true,
133146
alignPropertyValuePairs: true,
147+
useCorrectCasing: true,
134148
};
135149

136150
const defaultIntegratedConsoleSettings: IIntegratedConsoleSettings = {

0 commit comments

Comments
 (0)