I'm working with avro .avsc schemas now and I like formatting in samples:
{
"namespace": "example.avro",
"type": "record",
"name": "User",
"fields": [
{"name": "name", "type": "string"},
{"name": "favorite_number", "type": ["int", "null"]},
{"name": "favorite_color", "type": ["string", "null"]}
]
}
I mean one-line field definitions {"name": "name", "type": "string"}
specifically.
I'd like to edit and format my schemas in vscode, but it keeps wrapping fields like
{
"name": "name",
"type": "string"
}
I tried to configure default json formatter and with beautify
extension in setting.json
, but got no luck
"[json]": {
"editor.tabSize": 2,
"editor.wordWrap": "off",
"editor.defaultFormatter": "vscode.json-language-features",
// "editor.defaultFormatter": "HookyQR.beautify"
},
"html.format.wrapAttributes": "preserve",
"beautify.config": {
"indent_size": 2,
"indent_char": " ",
"preserve_newlines": true,
"space_in_paren": true,
"space_in_empty_paren": true,
"wrap_attributes": "preserve",
},