PHPStorm 7.3.1 JSON格式化工具

时间:2014-04-03 18:59:57

标签: json plugins ide format phpstorm

我使用PHPstorm IDE并希望找到一个格式化JSON的插件,以便我更容易阅读。

目前我在IDE中显示的文件中有这个:

{"property":"value1","property2":"value2","array1":[{"attr1":"value1"},{"attr2":"value2"}]}

我想要一个可以运行的插件,以便我可以看一下这个:

{
   "property": "value1",
   "property2": "value2",
   "array1": [
      {
         "attr1": "value1"
      },{
         "attr2": "value2"
      }
   ]
}

我找到了以下插件,但它似乎不适用于PHPStorm:http://plugins.jetbrains.com/plugin/3964?pr=

3 个答案:

答案 0 :(得分:46)

可能是因为我是PHPStorm的新手,但菜单中的选项代码 - > 重新格式代码 CTRL + ALT + L )可以在.json file中完成工作,并且在.js file中找到了一份好工作。

答案 1 :(得分:1)

在2017年的phpStorm中

档案>设置>编辑>代码风格> JSON

然后设置标签大小,缩进和延续缩进。

或"设置自......"如果您为其他代码样式定义了缩进并想要复制它。

答案 2 :(得分:0)

to format files "json, html, php, ...." it's:
for window CTRL + ALT + L)
for mac: (Cmmand + Option + L). 
相关问题