I want to format JSON files in my eclipse to save the file action depending on the number of spaces that I can configure. I tried to use the JSON Editor Plugin, but it gave me a null pointer exception when saving.
Then I tried JSON Tools and it worked, but it used a tab to format the strings. Is there any hack I can do with the plugin bank to tune and change the TAB to 4 spaces? Are the best json formatting for eclipse?
Have you tried Json Tools for Eclipse ? This is a handy and easy Eclipse plugin. I checked it right now, and it works as you wish - if there is a TAB in the modified JSON file, they change to 4 spaces.
You can find it in the Marketplace or install it using the update site:
https://bitbucket.org/denmiroch/jsontools/src/default/JsonSite/
In Eclipse 4.6 (Neon), the JSON editor is included in the Eclipse IDE for Java EE developers.
Some other extensions adhere to a set of preferences for a common text editor.
If it does not encounter other settings, you can try:
General → Appearance → Editors → Text Editors
[x] Insert spaces for tabs