Skip to content

Commit 40cacf6

Browse files
bergmeisterTylerLeonhardt
authored andcommitted
add PipelineIndentationStyle mapping (#836)
1 parent 2316b35 commit 40cacf6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs

+23
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,27 @@ public enum CodeFormattingPreset
141141
Stroustrup
142142
}
143143

144+
/// <summary>
145+
/// Multi-line pipeline style settings.
146+
/// </summary>
147+
public enum PipelineIndentationStyle
148+
{
149+
/// <summary>
150+
/// After the indentation level only once after the first pipeline and keep this level for the following pipelines.
151+
/// </summary>
152+
IncreaseIndentationForFirstPipeline,
153+
154+
/// <summary>
155+
/// After every pipeline, keep increasing the indentation.
156+
/// </summary>
157+
IncreaseIndentationAfterEveryPipeline,
158+
159+
/// <summary>
160+
/// Do not increase indentation level at all after pipeline.
161+
/// </summary>
162+
NoIndentation
163+
}
164+
144165
public class CodeFormattingSettings
145166
{
146167
/// <summary>
@@ -172,6 +193,7 @@ public CodeFormattingSettings(CodeFormattingSettings codeFormattingSettings)
172193
public bool OpenBraceOnSameLine { get; set; }
173194
public bool NewLineAfterOpenBrace { get; set; }
174195
public bool NewLineAfterCloseBrace { get; set; }
196+
public PipelineIndentationStyle PipelineIndentationStyle { get; set; }
175197
public bool WhitespaceBeforeOpenBrace { get; set; }
176198
public bool WhitespaceBeforeOpenParen { get; set; }
177199
public bool WhitespaceAroundOperator { get; set; }
@@ -250,6 +272,7 @@ private Hashtable GetCustomPSSASettingsHashtable(int tabSize, bool insertSpaces)
250272
{"PSUseConsistentIndentation", new Hashtable {
251273
{"Enable", true},
252274
{"IndentationSize", tabSize},
275+
{"PipelineIndentation", PipelineIndentationStyle },
253276
{"Kind", insertSpaces ? "space" : "tab"}
254277
}},
255278
{"PSUseConsistentWhitespace", new Hashtable {

0 commit comments

Comments
 (0)