Make the indent size configurable for an JsonText
instance
#1841
daxian-dbw
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Today, the indent size for rendering a
JsonText
instance is hard coded to be 3 spaces. For a deep JSON object, it'd nice if I can set the indent size to be 2 to have more rendered within the same console space. So, I propose to make the indent size configurable for anJsonText
instance.The change should be simple:
JsonBuilderContext
int IndentWidth
int indentWidth
, and assign its value to the read-only propertyIndentWidth
InsertIndentation
method to haveIndentation * IndentWidth
instead.IndentWidth
toJsonText
to allow user set valueJsonBuilderContext
instance in theBuild()
method.I think it may be reasonable to make sure the value assigned to
IndentWidth
is between 2 and 4 inclusively, to make user only choose from 2, 3, or 4 spaces.If maintainers are willing to accept this change, I'm happy to submit a PR for it.
Beta Was this translation helpful? Give feedback.
All reactions