Closed keenahn closed 3 years ago
Does this still happen? What version of sublime? What version of Pretty JSON? I can't reproduce this with the latest version of sublime or pretty json
PrettyJSON 1.1.1 here. I have the same issue. With the following validated JSON:
{
"calico": {
"external_routers": [
{
"asNumber": "1234",
"ip": "1.2.3.4",
"name": "router"
}
]
}
}
If I Format JSON
then it becomes:
{
"calico":
{
"external_routers": [{, "asNumber": "1234", "ip": "1.2.3.4", "name": "router", }]
}
}
which is clearly Invalid JSON
PrettyJSON 1.1.1 here. I have the same issue. With the following validated JSON:
{ "calico": { "external_routers": [ { "asNumber": "1234", "ip": "1.2.3.4", "name": "router" } ] } }
If I
Format JSON
then it becomes:{ "calico": { "external_routers": [{, "asNumber": "1234", "ip": "1.2.3.4", "name": "router", }] } }
which is clearly Invalid JSON
I see, is the below the expected behavior?
Fixed with latest release
Hello, I think the issue still occurs in version 1.2.1 :-(.
Source JSON:
[{"a": {"b": "c"}}]
After Format JSON
command:
[{"a": {,"b": "c"},}]
My user settings only override keep_arrays_single_line
:
{
"keep_arrays_single_line": true
}
Next release fixes this
Example:
Good:
Bad:
My guess is that there's something happening with your parser where it's looking for the
[
symbol