【发布时间】:2012-12-26 16:56:10
【问题描述】:
[更新:在此问题发布 8 小时后,JSON bundle 的作者收到了该问题的通知并修复了该问题。]
我在文件 application.json 中有以下 JSON 数据,显示在本文末尾,我使用 TextMate 和 JSON bundle、Emacs、BBEdit 和 Sublime Text 2 来正确缩进它,但所有好像他们做不到。
TextMate 和 Sublime Text 2 都坚持第一个 { 不应该缩进,第一个主要问题是 "child": { 的右大括号。 TextMate 和 Sublime Text 2 都拒绝在"child": { 的左侧下方对齐}。 Emacs 不断为每一行进一步缩进,而 BBEdit 似乎根本没有重新缩进功能(可能是这个吗?)。
有没有办法正确缩进文件,或者 TextMate 和 Sublime Text 2 都在为 JSON 数据做正确的事情?
[
{
"settings": [ "master" ],
"appPort": "8666",
"specs": {
"frame" : {
"type" : "HTMLFrameMojit",
"config": {
"deploy": true,
"child": {
"type" : "HelloWorldMojit"
},
"assets": {
"top": {
"css": [
"/static/HelloWorldMojit/assets/index.css"
]
}
}
}
}
}
},
{
"settings": [ "environment:development" ],
"staticHandling": {
"forceUpdate": true
}
}
]
【问题讨论】:
标签: json emacs textmate sublimetext2 bbedit