@@ -72,9 +72,24 @@ type Config struct {
72
72
// Not yet supported.
73
73
AlwaysMarkStrings bool
74
74
75
- AlwaysUseMapComplexStyle bool
75
+ // Set to true if you want type info to be skipped for any type that's in the Prelude
76
+ // (e.g. instead of `string<String>{` seeing only `string{` is preferred, etc).
77
+ //
78
+ // Not yet supported.
79
+ ElidePreludeTypeInfo bool
80
+
81
+ // Set to true if you want maps to use "complex"-style printouts:
82
+ // meaning they will print their keys on separate lines than their values,
83
+ // and keys may spread across mutiple lines if appropriate.
84
+ //
85
+ // If not set, a heuristic will be used based on if the map is known to
86
+ // have keys that are complex enough that rendering them as oneline seems likely to overload.
87
+ // See Config.useCmplxKeys for exactly how that's deteremined.
88
+ UseMapComplexStyleAlways bool
76
89
77
- SpecificMapComplexStyle map [schema.TypeName ]bool
90
+ // For maps to use "complex"-style printouts (or not) per type.
91
+ // See docs on UseMapComplexStyleAlways for the overview of what "complex"-style means.
92
+ UseMapComplexStyleOnType map [schema.TypeName ]bool
78
93
}
79
94
80
95
func (cfg * Config ) init () {
@@ -101,14 +116,14 @@ func (cfg Config) useRepr(typ schema.Type, isInKey bool) bool {
101
116
102
117
// useCmplxKeys decides if a map should print itself using a multi-line and extra-indented style for keys.
103
118
func (cfg Config ) useCmplxKeys (mapn datamodel.Node ) bool {
104
- if cfg .AlwaysUseMapComplexStyle {
119
+ if cfg .UseMapComplexStyleAlways {
105
120
return true
106
121
}
107
122
tn , ok := mapn .(schema.TypedNode )
108
123
if ! ok {
109
124
return false
110
125
}
111
- force , ok := cfg .SpecificMapComplexStyle [tn .Type ().Name ()]
126
+ force , ok := cfg .UseMapComplexStyleOnType [tn .Type ().Name ()]
112
127
if ok {
113
128
return force
114
129
}
0 commit comments