File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -2925,7 +2925,7 @@ let genBinding (b: BindingNode) (ctx: Context) : Context =
29252925 +> afterLetKeyword
29262926 +> sepSpace
29272927 +> genFunctionName
2928- +> indent
2928+ +> experimentalDoubleIndent
29292929 +> sepNln
29302930 +> genParameters
29312931 +> onlyIf nlnOnSeparateLine sepNln
@@ -2934,7 +2934,7 @@ let genBinding (b: BindingNode) (ctx: Context) : Context =
29342934 sepNln +> genSingleTextNode b.Equals
29352935 else
29362936 sepSpace +> genSingleTextNode b.Equals)
2937- +> unindent
2937+ +> experimentalDoubleUnindent
29382938 +> onlyIf hasTriviaAfterLeadingKeyword unindent)
29392939 ctx
29402940
Original file line number Diff line number Diff line change @@ -391,6 +391,24 @@ let indent (ctx: Context) =
391391let unindent ( ctx : Context ) =
392392 writerEvent ( UnIndentBy ctx.Config.IndentSize) ctx
393393
394+ let experimentalDoubleIndent ( ctx : Context ) =
395+ let indentSize =
396+ if not ctx.Config.ExperimentalDoubleIndentParameters then
397+ ctx.Config.IndentSize
398+ else
399+ 2 * ctx.Config.IndentSize
400+
401+ writerEvent ( IndentBy indentSize) ctx
402+
403+ let experimentalDoubleUnindent ( ctx : Context ) =
404+ let indentSize =
405+ if not ctx.Config.ExperimentalDoubleIndentParameters then
406+ ctx.Config.IndentSize
407+ else
408+ 2 * ctx.Config.IndentSize
409+
410+ writerEvent ( UnIndentBy indentSize) ctx
411+
394412/// Apply function f at an absolute indent level (use with care)
395413let atIndentLevel alsoSetIndent level ( f : Context -> Context ) ( ctx : Context ) =
396414 if level < 0 then
Original file line number Diff line number Diff line change @@ -78,6 +78,15 @@ val lastWriteEventIsNewline: ctx: Context -> bool
7878val indent : ctx : Context -> Context
7979/// Unindent one more level based on configuration
8080val unindent : ctx : Context -> Context
81+
82+ /// Add double indent if ExperimentalDoubleIndentParameters is active
83+ /// Otherwise , add single indent
84+ val experimentalDoubleIndent : ctx : Context -> Context
85+
86+ /// Add double unindent if ExperimentalDoubleIndentParameters is active
87+ /// Otherwise , add single unindent
88+ val experimentalDoubleUnindent : ctx : Context -> Context
89+
8190// /// Apply function f at an absolute indent level ( use with care )
8291val atIndentLevel : alsoSetIndent : bool -> level : int -> f : ( Context -> Context ) -> ctx : Context -> Context
8392// /// Set minimal indentation ( `atColumn` ) at current column position - next newline will be indented on `max indent atColumn`
You can’t perform that action at this time.
0 commit comments