Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow custom sort function depending on filetype #53201

Closed
e110c0 opened this issue Jun 28, 2018 · 4 comments
Closed

allow custom sort function depending on filetype #53201

e110c0 opened this issue Jun 28, 2018 · 4 comments
Assignees
Labels
editor-commands Editor text manipulation commands *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality

Comments

@e110c0
Copy link

e110c0 commented Jun 28, 2018

currently, "sort lines ascending" sorts alphabetically caseinsensitive.
While this makes sense most of the time, there are case where a more specific ordering would be preferable,

Example: Sass/CSS ordering

when sorting in Sass/Css files, the current sorting order is a counter intuitive:

border: ...
border-radius: ...

will become

border-radius: ...
border: ...

because it orders '-' before ':' but in this specific case, it's preferable to go from generic to specific, i.e. ordering border before border-radius.

with a way to provide a custom sort function (or have some to choose from) would allow to get this way of sorting

@vscodebot
Copy link

vscodebot bot commented Jun 28, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@e110c0
Copy link
Author

e110c0 commented Jun 28, 2018

#48123 is similar (requesting ASCII compare instead of localeCompare) but this would not resolve this specific situation since - (45) comes before : (58)

@alexdima
Copy link
Member

This could be implemented from an extension. Specifically, for CSS, a formatter could be written that always sorts properties in a certain order ...

@alexdima alexdima added feature-request Request for new features or functionality editor-commands Editor text manipulation commands labels Jun 28, 2018
@alexdima alexdima added the *extension-candidate Issue identified as good extension implementation label Oct 17, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 17, 2019

We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Oct 17, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-commands Editor text manipulation commands *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants