From 299ebceac45f7cfce97a4891a5b371592b4525d1 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:08:39 -0800 Subject: [PATCH] BinPack.ParentCtors: describe each option in doc --- docs/configuration.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 8c64666f7..f10b3a874 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -5041,6 +5041,10 @@ The behaviour of `binPack.parentConstructors = source` depends on the value of [`newlines.source`](#newlinessource); `keep` maps to `keep` and attempts to preserve the space if there's no line break in the source, `fold` maps to `Oneline`, rest to `Never`. +#### `binPack.parentConstructors=Always` + +This option attempts to binpack parents, formatting as many on each line as will fit. + ```scala mdoc:scalafmt binPack.parentConstructors = Always maxColumn = 30 @@ -5053,6 +5057,12 @@ object A { } ``` +#### `binPack.parentConstructors=Never` + +This option will attempt to format the entire declaration on one line (starting +with `class` or `trait` and including all parents); otherwise, will enforce +breaks before each. + ```scala mdoc:scalafmt binPack.parentConstructors = Never maxColumn = 30 @@ -5062,6 +5072,11 @@ object A { } ``` +#### `binPack.parentConstructors=Oneline` + +This option will attempt to format all parents on one line (starting with +`extends` and including all parents); otherwise, will enforce breaks before each. + ```scala mdoc:scalafmt binPack.parentConstructors = Oneline maxColumn = 30 @@ -5079,6 +5094,12 @@ object A { } ``` +#### `binPack.parentConstructors=OnelineIfPrimaryOneline` + +This option will attempt to format all parents on one line (from `extends` and +including all parents), but only if the primary constructor fits on one line +as well (the same or previous); otherwise, will enforce breaks before each. + ```scala mdoc:scalafmt binPack.parentConstructors = OnelineIfPrimaryOneline maxColumn = 30 @@ -5095,6 +5116,10 @@ object A { } ``` +#### `binPack.parentConstructors=keep` + +This option attempts to preserve breaks before each parent. + ```scala mdoc:scalafmt binPack.parentConstructors = keep ---