You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When users know in advance that the JSON data to write is rather small, but they still want increased readability, they might not want line breaks but a space after , and :. For example:
{"a": [1, 2, 3], "b": true}
Even with the upcoming FormattingStyle (#2231) this is currently not possible. See also slightly related discussion in #2327 (comment).
Feature description
Extend FormattingStyle with a setting withSpaceAfterSeparator(boolean) (or similar):
true: always add a space after :, and in case the newline value of the style is empty, also add a space after ,
false: don't add a space after : and ,
Note: This has no effect on the newline value of the style. If the newline is not empty it will still be added after , and no space will be added after the ,, regardless of the withSpaceAfterSeparator value.
Alternatives / workarounds
None?
But maybe this use case is not common enough to justify adding a new FormattingStyle method.
The text was updated successfully, but these errors were encountered:
Problem solved by the feature
When users know in advance that the JSON data to write is rather small, but they still want increased readability, they might not want line breaks but a space after
,
and:
. For example:Even with the upcoming
FormattingStyle
(#2231) this is currently not possible. See also slightly related discussion in #2327 (comment).Feature description
Extend
FormattingStyle
with a settingwithSpaceAfterSeparator(boolean)
(or similar):true
: always add a space after:
, and in case the newline value of the style is empty, also add a space after,
false
: don't add a space after:
and,
Note: This has no effect on the newline value of the style. If the newline is not empty it will still be added after
,
and no space will be added after the,
, regardless of thewithSpaceAfterSeparator
value.Alternatives / workarounds
None?
But maybe this use case is not common enough to justify adding a new
FormattingStyle
method.The text was updated successfully, but these errors were encountered: