Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

sort the result in json like babeledit #390

Open
tlightsky opened this issue May 7, 2020 · 9 comments
Open

sort the result in json like babeledit #390

tlightsky opened this issue May 7, 2020 · 9 comments

Comments

@tlightsky
Copy link

sort the result in json like babeledit instead of add to end of file

https://www.codeandweb.com/babeledit

@gilmarsquinelato
Copy link
Owner

what version are you using of the app?

@tlightsky
Copy link
Author

it's 1.0.0 i think,
i use released exe version on windows

@gilmarsquinelato
Copy link
Owner

try to update to the latest version please

@tlightsky
Copy link
Author

ok, just tried development branch,
still add new item to the end of the json file,
it won't sort the json file keys

@tlightsky
Copy link
Author

i changed it locally and it works fine,
made a pr for it

@gilmarsquinelato
Copy link
Owner

Merged!

@gilmarsquinelato
Copy link
Owner

@tlightsky one thing that I thought here, your PR won't do the same for nested keys only for flat objects.
This is a problem because we'll have different behaviour depending on the nesting level of the object.
Another thing is that there was an issue in the past asking for respecting the object order because is not everyone that wants the keys alphabetically sorted, some of them have grouped sorting.

The old issue is #211.
So I don't think that this improvement would result in a thing that everyone likes.

@tlightsky
Copy link
Author

tlightsky commented May 10, 2020

it won't sort nested keys,
if we want to support that,
need to find another way,
i only have flat keys though.

yeah, that's a point,
so we should put it into some config file?

@gilmarsquinelato
Copy link
Owner

Personally I don't know if sorting the keys should be the responsibility of the app.
Because this is a personal thing for each project and developer.
As far as I understood, we have 2 sorting ways, alphabetically sorted and grouped sorted, that they group in chunks and in that chunks they sort for proximity or something else.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants