R35007 / sort-json-vscode-extension

Simple JSON Object and Array sort
MIT License
14 stars 2 forks source link

support sort selected json properties #8

Closed tjx666 closed 1 year ago

tjx666 commented 1 year ago

My use case is to sort the settings.json. In following screenshot, I only want to sort the selected properties in the red box;

image

Another same condition is to sort tsconfig.json:

image
R35007 commented 1 year ago

Hi @tjx666,

I understand your concern, but sorry this is not possible in this extension. This extension is used to sort an object or list. The selected string must be a valid JavaScript object. Just a part of a string cant be sorted.

The alternative way is to use the vscode native sort lines ascending and sort lines descending.

Thanks, Siva