From a5487d7104c176ae6363744a988be9c0d303319a Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 20 Dec 2018 17:55:48 +0000 Subject: [PATCH 1/2] Add powershell.codeformatting.pipelineIndentationStyle setting --- package.json | 10 ++++++++++ src/settings.ts | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/package.json b/package.json index 5153b58461..00d60ad854 100644 --- a/package.json +++ b/package.json @@ -565,6 +565,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, diff --git a/src/settings.ts b/src/settings.ts index c7a87ffef7..e8f6fc4a4f 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,6 +45,7 @@ export interface ICodeFormattingSettings { openBraceOnSameLine: boolean; newLineAfterOpenBrace: boolean; newLineAfterCloseBrace: boolean; + pipelineIndentationStyle: PipelineIndentationStyle; whitespaceBeforeOpenBrace: boolean; whitespaceBeforeOpenParen: boolean; whitespaceAroundOperator: boolean; @@ -125,6 +132,7 @@ export function load(): ISettings { openBraceOnSameLine: true, newLineAfterOpenBrace: true, newLineAfterCloseBrace: true, + pipelineIndentationStyle: PipelineIndentationStyle.IncreaseIndentationForFirstPipeline, whitespaceBeforeOpenBrace: true, whitespaceBeforeOpenParen: true, whitespaceAroundOperator: true, From f0e68cc8d36c4b97ee17bfd6d082e78798846392 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Tue, 8 Jan 2019 23:20:57 +0000 Subject: [PATCH 2/2] fix indentation --- package.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 876e413ac5..bcd07405d1 100644 --- a/package.json +++ b/package.json @@ -592,15 +592,15 @@ "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." - }, + "type": "string", + "enum": [ + "IncreaseIndentationForFirstPipeline", + "IncreaseIndentationAfterEveryPipeline", + "NoIndentation" + ], + "default": "IncreaseIndentationForFirstPipeline", + "description": "Multi-line pipeline style settings." + }, "powershell.codeFormatting.whitespaceBeforeOpenBrace": { "type": "boolean", "default": true,