vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

Sort feature

Open gdlx opened this issue 7 years ago • 6 comments

Hi,

It would be nice to add a keys sorting feature. I use this a lot under Atom for my locale translations files: https://github.com/elledienne/easysort-yaml

gdlx avatar Jun 22 '18 14:06 gdlx

I'd love to see this as well. For the time being I can sometimes get away with converting YAML to JSON and sorting the result, but it's a pretty silly kludge.

phyllisstein avatar May 07 '19 11:05 phyllisstein

This is actually needed to minimize conflicts during merges. Keeping lists/dicts sorted helps a lot to minimize diffs.

prokher avatar Sep 12 '19 09:09 prokher

This works identically to the atom plugin: https://github.com/pascalre/vscode-yaml-sort @phyllisstein, @prokher, @gdlx.

utilityboy avatar Sep 12 '19 14:09 utilityboy

There is already a good solution for this on the marketplace. I am not sure if there are any advantages to duplicating that functionality in this extension.

gorkem avatar Mar 07 '22 05:03 gorkem

Can you please reopen this? vscode-yaml-sortremoves comments on sorting which IMHO is a reason to not use it: https://github.com/pascalre/vscode-yaml-sort/issues/39

I'd therefore be really thankful if vscode-yaml could provide a better sorting solution

schlomo avatar Mar 16 '22 08:03 schlomo

is there any update about this enhancement? 🙏

gregpavl avatar Sep 21 '22 20:09 gregpavl

I also really need this feature. If there is no plan from the owner of this repo, I can try to implement and send a pr.

borontion avatar Apr 15 '23 01:04 borontion

This was fixed with https://github.com/redhat-developer/yaml-language-server/pull/839 please give it a try.

gorkem avatar Apr 15 '23 01:04 gorkem

This was fixed with redhat-developer/yaml-language-server#839 please give it a try.

Hi @gorkem, thanks for the great feature. Just want to ensure whether it is sort keys on format supported? Seems I failed to make it though it is mentioned to have a code action in the pull request.

huxuan avatar Aug 02 '23 03:08 huxuan