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
JsonTextinstance 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 anJsonTextinstance.The change should be simple:
JsonBuilderContextint IndentWidthint indentWidth, and assign its value to the read-only propertyIndentWidthInsertIndentationmethod to haveIndentation * IndentWidthinstead.IndentWidthtoJsonTextto allow user set valueJsonBuilderContextinstance in theBuild()method.I think it may be reasonable to make sure the value assigned to
IndentWidthis 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