I would like to format JSON like this (space replaced with _ to show indention)
{
____“file_format_identifier”:_1.2,
____“files”:
____[
________{
___________“filename”:“lights.gltf”,
____________“instances”:
____________[
________________{
____________________“transform”:
____________________{
________________________“scale”:
________________________[
____________________________0.084,
____________________________0.084,
____________________________0.084
________________________],
________________________“rotation”:
________________________[
____________________________0,
____________________________1.16,
____________________________0
________________________],
________________________“translation”:
________________________[
____________________________1.15034,
____________________________2.13788,
____________________________4.63639
________________________]
____________________}
________________}
____________]
________}
____]
}
Could you please advise with the .clang-format_fields?
I tried with clang-format-18 and VS Code, with no luck.
Currently, it gives me
{
____“file_format_identifier”:_1.2,
___“files”:[
________{
___________“filename”:“lights.gltf”,
___________“instances”:[
_______________{
____________________“transform”:{
_______________________“scale”:[
____________________________0.084,
____________________________0.084,
____________________________0.084
________________________],
_______________________“rotation”:[
____________________________0,
____________________________1.16,
____________________________0
________________________],
_______________________“translation”:[
____________________________1.15034,
____________________________2.13788,
____________________________4.63639
________________________]
____________________}
________________}
____________]
________}
____]
}
I use this in .clang-format:
Language:_Json
IndentWidth:_4
BraceWrapping:
__AfterCaseLabel:_true
__AfterClass:_true
__AfterControlStatement:_Always
__AfterEnum:_true
__AfterFunction:_true
__AfterNamespace:_true
__AfterObjCDeclaration:_true
__AfterStruct:_true
__AfterUnion:_true
__AfterExternBlock:_true
__BeforeCatch:_true
__BeforeElse:_true
__BeforeLambdaBody:_true
__BeforeWhile:_true
__IndentBraces:_true
__SplitEmptyFunction:_true
__SplitEmptyRecord:_true
BreakBeforeBraces:_Allman
Thank you very much!