When I create a .json file in PyCharm and put in some JSON, I'm expecting it to format it as per the format shown under File-> Settings-> Editor-> Code Style-> JSON.
But instead, my code stays as it is - e.g. more than one JSON key value pair on the same line, like this:
{"just a test": "does this work","this should format": "but it doesn't"}
How can I make it so that when I open a .json file with PyCharm, it's nicely formatted?
I have checked that .json files are associated in the Editor-> File types dialogue, and the editor tab correctly has the JSON icon, so PyCharm knows it's a JSON file.
Is there a key combination I have to hit to get it to format prettily or something?
My file is with .json extension for it. Then, i clicked on Code-> Reformate Code and then I see a pretty JSON!
PyCharm doesn't auto-format it, if I paste in open json-file non-formatted JSON, it stays non-formatted. But if I press Ctrl + Alt + L on PC, it formats it nicely!
Thanks its work for me "Code-> Reformate Code"!!!