我现在正在使用avro .avsc模式,我喜欢样例的格式:
{
"namespace": "example.avro",
"type": "record",
"name": "User",
"fields": [
{"name": "name", "type": "string"},
{"name": "favorite_number", "type": ["int", "null"]},
{"name": "favorite_color", "type": ["string", "null"]}
]
}
我是指一行字段定义,特别是{"name": "name", "type": "string"}
。
我想在 VSCode 中编辑和格式化我的模式,但它会将字段包装成多行:
{
"name": "name",
"type": "string"
}
我尝试在setting.json
中配置默认的JSON格式化程序,并使用beautify
扩展,但没有成功。
"[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",
},