diff --git a/package.json b/package.json index bf9acc85ea..b151767da3 100644 --- a/package.json +++ b/package.json @@ -656,10 +656,11 @@ "enum": [ "IncreaseIndentationForFirstPipeline", "IncreaseIndentationAfterEveryPipeline", - "NoIndentation" + "NoIndentation", + "None" ], - "default": "NoIndentation", - "description": "Multi-line pipeline style settings." + "default": "None", + "description": "Multi-line pipeline style settings (default: None)." }, "powershell.codeFormatting.whitespaceBeforeOpenBrace": { "type": "boolean", @@ -686,10 +687,20 @@ "default": true, "description": "Adds a space after an opening brace ('{') and before a closing brace ('}')." }, - "powershell.codeFormatting.whitespaceAroundPipe": { + "powershell.codeFormatting.whitespaceBetweenParameters": { + "type": "boolean", + "default": false, + "description": "Removes redundant whitespace between parameters." + }, + "powershell.codeFormatting.addWhitespaceAroundPipe": { "type": "boolean", "default": true, - "description": "Adds a space before and after the pipeline operator ('|')." + "description": "Adds a space before and after the pipeline operator ('|') if it is missing." + }, + "powershell.codeFormatting.trimWhitespaceAroundPipe": { + "type": "boolean", + "default": false, + "description": "Trims extraneous whitespace (more than 1 character) before and after the pipeline operator ('|')." }, "powershell.codeFormatting.ignoreOneLineBlock": { "type": "boolean", diff --git a/src/settings.ts b/src/settings.ts index fdaacab742..a5f4cbd51e 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -18,6 +18,7 @@ enum PipelineIndentationStyle { IncreaseIndentationForFirstPipeline, IncreaseIndentationAfterEveryPipeline, NoIndentation, + None, } export enum HelpCompletion { @@ -51,8 +52,10 @@ export interface ICodeFormattingSettings { whitespaceBeforeOpenParen: boolean; whitespaceAroundOperator: boolean; whitespaceAfterSeparator: boolean; - whitespaceInsideBrace: true; - whitespaceAroundPipe: true; + whitespaceBetweenParameters: boolean; + whitespaceInsideBrace: boolean; + addWhitespaceAroundPipe: boolean; + trimWhitespaceAroundPipe: boolean; ignoreOneLineBlock: boolean; alignPropertyValuePairs: boolean; useCorrectCasing: boolean; @@ -158,13 +161,15 @@ export function load(): ISettings { openBraceOnSameLine: true, newLineAfterOpenBrace: true, newLineAfterCloseBrace: true, - pipelineIndentationStyle: PipelineIndentationStyle.NoIndentation, + pipelineIndentationStyle: PipelineIndentationStyle.None, whitespaceBeforeOpenBrace: true, whitespaceBeforeOpenParen: true, whitespaceAroundOperator: true, whitespaceAfterSeparator: true, + whitespaceBetweenParameters: false, whitespaceInsideBrace: true, - whitespaceAroundPipe: true, + addWhitespaceAroundPipe: true, + trimWhitespaceAroundPipe: false, ignoreOneLineBlock: true, alignPropertyValuePairs: true, useCorrectCasing: false,