diff --git a/package.json b/package.json index bc7682a090..a8e7400871 100644 --- a/package.json +++ b/package.json @@ -637,6 +637,16 @@ "default": true, "description": "Adds a newline (line break) after a closing brace." }, + "powershell.codeFormatting.pipelineIndentationStyle": { + "type": "string", + "enum": [ + "IncreaseIndentationForFirstPipeline", + "IncreaseIndentationAfterEveryPipeline", + "NoIndentation" + ], + "default": "IncreaseIndentationForFirstPipeline", + "description": "Multi-line pipeline style settings." + }, "powershell.codeFormatting.whitespaceBeforeOpenBrace": { "type": "boolean", "default": true, @@ -657,6 +667,16 @@ "default": true, "description": "Adds a space after a separator (',' and ';')." }, + "powershell.codeFormatting.WhitespaceInsideBrace": { + "type": "boolean", + "default": true, + "description": "Adds a space after an opening brace ('{') and before a closing brace ('}')." + }, + "powershell.codeFormatting.WhitespaceAroundPipe": { + "type": "boolean", + "default": true, + "description": "Adds a space before and after the pipeline operator ('|')." + }, "powershell.codeFormatting.ignoreOneLineBlock": { "type": "boolean", "default": true, @@ -667,6 +687,11 @@ "default": true, "description": "Align assignment statements in a hashtable or a DSC Configuration." }, + "powershell.codeFormatting.useCorrectCasing": { + "type": "boolean", + "default": true, + "description": "Use correct casing for cmdlets." + }, "powershell.integratedConsole.showOnStartup": { "type": "boolean", "default": true, diff --git a/src/settings.ts b/src/settings.ts index c7a87ffef7..b12c9dfd77 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -14,6 +14,12 @@ enum CodeFormattingPreset { Stroustrup, } +enum PipelineIndentationStyle { + IncreaseIndentationForFirstPipeline, + IncreaseIndentationAfterEveryPipeline, + NoIndentation, +} + export enum HelpCompletion { Disabled = "Disabled", BlockComment = "BlockComment", @@ -39,12 +45,16 @@ export interface ICodeFormattingSettings { openBraceOnSameLine: boolean; newLineAfterOpenBrace: boolean; newLineAfterCloseBrace: boolean; + pipelineIndentationStyle: PipelineIndentationStyle; whitespaceBeforeOpenBrace: boolean; whitespaceBeforeOpenParen: boolean; whitespaceAroundOperator: boolean; whitespaceAfterSeparator: boolean; + WhitespaceInsideBrace: true; + WhitespaceAroundPipe: true; ignoreOneLineBlock: boolean; alignPropertyValuePairs: boolean; + useCorrectCasing: boolean; } export interface IScriptAnalysisSettings { @@ -125,12 +135,16 @@ export function load(): ISettings { openBraceOnSameLine: true, newLineAfterOpenBrace: true, newLineAfterCloseBrace: true, + pipelineIndentationStyle: PipelineIndentationStyle.IncreaseIndentationForFirstPipeline, whitespaceBeforeOpenBrace: true, whitespaceBeforeOpenParen: true, whitespaceAroundOperator: true, whitespaceAfterSeparator: true, + WhitespaceInsideBrace: true, + WhitespaceAroundPipe: true, ignoreOneLineBlock: true, alignPropertyValuePairs: true, + useCorrectCasing: true, }; const defaultIntegratedConsoleSettings: IIntegratedConsoleSettings = {